Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
An array is an ordered list of values, typically created with the intention of looping through numerically indexed values, beginning with the index zero. What you need to know is that arrays are numerically ordered sets, versus objects, which have property names associated with values in non-numeric order. Essentially, arrays use numbers as a lookup key, while objects have user-defined property names. JavaScript does not have true associative arrays, but objects can be used to achieve the functionality of associate arrays.
Below, I store four strings in myArray that I can access using a numeric index.
I compare and contrast it to an object-literal mimicking an associative
array.