I love JS, the language is simple and awesome. In my university life I have solved Problem in Python Programming Language. Now Its JS Time! Its a post about Array in JavaScript. Because Array is interesting.
What is Array in Programming ?
Array is a variable of collection of elements . Think of a egg container. The container is a array and the eggs are elements. An array can contain multiple elements.
In the picture, you can see the elements and index ( position) . You can access a single elements using array[index] . If you want to get John from the array of the picture you can get it by array[4]. Array index start from zero .
What are the Array methods in JavaScript?
Array methods are built in JavaScript Functions, that can be applied to arrays to perform multiple function. For example, we can use .shift() to remove the first element .
["a","b","c","d","e"].at(0) // a
["a","b","c","d","e"].at(-1) // e
["a","b","c","d","e"].at(42) // undefined