Creating an Array
The following example also creates an Array, and assigns values to it:
Access the Elements of an Array
An array element is referred using the index number.
This statement accesses the value of the first element in cars:
This statement modifies the first element in cars:
Access the Full Array
Array Elements Can Be Objects
You can have functions in an Array. You can have arrays in an Array:
Adding Array Elements
The easiest way to add a new element to an array is using the push method.