An Overview of Array Methods in JavaScript

Learn about how to manipulate arrays in JavaScript Image by PaweÅ‚ CzerwiÅ„ski from Unsplash Let’s create an array: var numbers = [1,2,3,4,5] Array elements are accessed using an index. The index starts from 0 . So if we want to access the first element, then we need to access using index 0. numbers[0] // 1 numbers[3] // …

Different ways and correct way to delete an array .

Learn about what is the right way to delete an array in Javascript. Let’s create an Array let array = [1,2,3,4,5]; First way to delete an array is , referencing to a new empty array array = []; Let’s look an example var array1 = [1,2,3,4,5]; var array2 = array1; array1[0] = 100; array2[0]; //100 because …

Design a site like this with WordPress.com
Get started