Manipulating Arrays in JavaScript
Explore fundamental techniques for manipulating arrays in JavaScript, including how to create arrays, access their elements using indexes, determine their size with the length property, and store various data types. This lesson helps you build a solid understanding of array operations essential for efficient data management in web development.
We'll cover the following...
In JavaScript, an array is an object that has special properties.
Creating an array
Here’s how to create our list of movies in the form of an array.
An array is created with a pair of square brackets []. Everything within the brackets makes up the array. You can store different types of elements within an array, including strings, numbers, booleans and even objects.
Since an array may contain multiple elements, it’s good to name the array plurally (for example,
movies).
Obtaining an array’s size
The number of elements stored in an ...