10 - Arrays

JavaScript Arrays

Arrays are another useful data structure in JavaScript, that is based on Objects, which makes certain operations much easier to perform.

Arrays are a sequential collection of data that is stored with a numbered index. Remember that we use curly brackets to create an empty object. We can create an empty array in a similar fashion by using square brackets.

	var arr = [];

In this example, we created an empty array and used a variable called arr to store that array. Now if we wanted to add elements to this array, we can use the push method that array objects have.

Get hands-on with 1200+ tech skills courses.