15.2.4 Creating and initialising arrays in a single statement Another piece of JavaScript that would result in the same array as VERSION 1 above is the following // VERSION 2 - all in one line var weekDays = new Array "Monday, "Tuesday, "Wednesday, Thursday, "Friday, "Saturday, "Sunday This single statement combines the declaration of anew variable and Array object with assigning the seven weekday Strings. Notice that we have not had to specify the size of the array, since JavaScript knows there are seven Strings and so makes the array have a size of seven elements. The above examples illustrate that arrays can either be created separately (as in VERSION 1), and then have values assigned to elements, or that arrays can be created and provided with initial values all in one statement VERSION 2). When declaring the array, if you know which values the array should hold you would likely choose to create the array and provide the initial values in one statement. Otherwise the two-stage approach of first creating the array, and then later assigning the values, is appropriate.