Category: JavaScript Tutorial

python tutorials and learn python

Created with Sketch.

JavaScript Array Methods

JavaScript Array Methods This section provides you with the JavaScript Array methods that allow you to manipulate arrays effectively. Section 1. Array properties length property – show you how to use the length property of an array effectively. Section 2. Adding / removing elements push() – add one or more elements to the end of…
Read more

JavaScript String includes() Method

JavaScript String includes() Method Summary: in this tutorial, you will learn how to use the JavaScript String includes() method to check if a string contains another string. Introduction to JavaScript String includes() method The includes() method determines whether a string contains another string: string.includes(searchString [,position]) Code language: CSS (css) The includes() method returns true if…
Read more

JavaScript String endsWith

JavaScript String endsWith Summary: in this tutorial, you will learn how to use the JavaScript String endsWith() method to check if a string ends with a substring. Introduction to the JavaScript String endsWith() method The endsWith() returns true if a string ends with the characters of a specified string or false otherwise. Here’s the syntax…
Read more

JavaScript String startsWith()

JavaScript String startsWith() Summary: in this tutorial, you will learn how to use the JavaScript String startsWith() method to check if a string starts with a substring. Introduction to the JavaScript startsWith() method The startsWith() returns true if a string starts with a substring or false otherwise. The following shows the syntax of the startsWith()…
Read more

JavaScript Array findIndex() Method

JavaScript Array findIndex() Method Summary: in this tutorial, you will learn how to use the Array findIndex() method to find the first element that satisfies a given test. Introduction to the JavaScript Array findIndex() Method ES6 added a new method called findIndex() to the Array.prototype, which allows you to find the first element in an…
Read more

JavaScript Array find() Method

JavaScript Array find() Method Summary: in this tutorial, you will learn how to use the JavaScript find() method to search for the first element in an array, which satisfies a test. Introduction to the Array find() method In ES5, to find an element in an array, you use the indexOf() or lastIndexOf() methods. However, these…
Read more

JavaScript Array.from()

JavaScript Array.from() Summary: in this tutorial, you will learn about the JavaScript Array.from() method that creates a new array from an array-like or iterable object. Introduction to JavaScript Array Array.from() method To create an array from an array-like object in ES5, you iterate over all array elements and add each of them to an intermediate…
Read more

JavaScript Array.of()

JavaScript Array.of() Summary: in this tutorial, you will learn how to improve array construction using the JavaScript Array.of() method in ES6. Introduction to the JavaScript Array.of() method In ES5, when you pass a number to the Array constructor, JavaScript creates an array whose length equals the number. For example: let numbers = new Array(2); console.log(numbers.length);…
Read more

JavaScript Object Destructuring

JavaScript Object Destructuring Summary: in this tutorial, you’ll learn about JavaScript object destructuring which assigns properties of an object to individual variables. If you want to learn how to destructure an array, you can check out the array destructuring tutorial. Introduction to the JavaScript object destructuring assignment Suppose you have a person object with two…
Read more

ES6 Destructuring Assignment

ES6 Destructuring Assignment Summary: in this tutorial, you will learn how to use the ES6 destructuring assignment that allows you to destructure an array into individual variables. ES6 provides a new feature called destructing assignment that allows you to destructure properties of an object or elements of an array into individual variables. Let’s start with the…
Read more