Blog

python tutorials and learn python

Created with Sketch.

JavaScript Array indexOf and lastIndexOf: Locating an Element in an Array

JavaScript Array indexOf and lastIndexOf: Locating an Element in an Array Summary: in this tutorial, we will show you how to use the JavaScript array indexOf() and lastIndexOf() methods to find the position of an element in an array. Introduction to the JavaScript array indexOf() method To find the position of an element in an array, you use…
Read more

3 Pragmatic Uses of JavaScript Array slice() Method

3 Pragmatic Uses of JavaScript Array slice() Method The Array.prototype object provides the slice() method that allows you to extract subset elements of an array and add them to the new array. In this tutorial, we will show you the practical uses of the JavaScript array slice() method. Introduction to JavaScript Array slice() method The slice()…
Read more

JavaScript Array splice: Delete, Insert, and Replace

JavaScript Array splice: Delete, Insert, and Replace Summary: this tutorial shows you how to use the JavaScript Array’s splice() method to delete existing elements, insert new elements, and replace elements in an array. JavaScript Array type provides a very powerful splice() method that allows you to insert new elements into the middle of an array. However,…
Read more

JavaScript Array shift

JavaScript Array shift Summary: in this tutorial, you’ll learn how to use the JavaScript Array shift() method to remove the first element from an array. Introduction to the JavaScript Array shift() function The Array.prototype.shift() method removes the first element from an array and returns that element. The following shows the syntax of the shift() method:…
Read more

JavaScript Array Pop

JavaScript Array Pop Summary: in this tutorial, you’ll learn how to use the JavaScript Array pop() method to remove the last element from an array. Introduction to the JavaScript Array pop() method The Array.prototype.pop() method removes the last element from an array and returns the removed element. Here’s the syntax of the pop() method: array.pop()…
Read more

JavaScript Array unshift

JavaScript Array unshift Summary: in this tutorial, you’ll learn how to use the JavaScript Array unshift() method to add one or more elements to the beginning of an array. Introduction to the JavScript Array unshift() method The Array.prototype.unshift() method adds one or more elements to the beginning of an array and returns the new array’s…
Read more

JavaScript Array Push

JavaScript Array Push Summary: in this tutorial, you’ll learn how to use the JavaScript Array push() method to add one or more elements to the end of an array. Introduction to the JavaScript Array push() method The Array.prototype.push() method adds one or more elements to the end of an array and returns the new array’s…
Read more

JavaScript Array Length

JavaScript Array Length Summary: in this tutorial, you’ll learn about the JavaScript Array length property and how to handle it correctly. What exactly is the JavaScript Array length property By definition, the length property of an array is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. The…
Read more

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