USE ARRAYS
You can easily display the current date on your Web page using the methods of
the Date object. To display the date in a particular format,
another helpful object is the Array object.
An array is a collection of data. It can include text, numbers, or both. All
Web programming languages include arrays. In JavaScript, you create an array
by using the keyword new and Array(), for example:
var myArray = new Array();
This code creates an empty array.
Positions in an array are indexed, so you can refer to the data contained in any particular location in an array by using the index number in square brackets, such as:
var myValue = myArray[2];
Index values start at 0, not at 1, so the first position in the array is 0.
You can add a set of values to an array, for example:
myArray = [a,b,c];
This assigns a to the first position in the array,
myArray[0], b to the second position, myArray[1],
and c to the third position, myArray[2].
You can also assign array values individually, for example:
memberAges[5] = 52;
Array values don't need to be added in order. If you add only one value, the
other values in the array are undefined. If you only assigned a value for the
sixth position in memberAges, as in the previous line of code,
the first five position values would be undefined.
