Arrays are another useful data structure in JavaScript. They are a sequential collection of data stored with a numbered index and are based on Objects, which make certain operations much easier to perform.
In this chapter we’ll populate an array using the push method. We’ll also learn about the remainder operator, which we can use to derive sequential values that cycle in between zero and the desired value.
Using the push Method
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 (Listing 10-1).