5 - Javascript:Arrays - Introduction
WHAT IS AN ARRAY?
The formal definition of an array states that it's an "ordered
collection of data." In plain English, this means that an array is like
a storage bin that can hold any number of hunks o' data (or nothing at all,
if the array is empty), and the data is maintained in a fixed sequence determined
by the scripter. All this takes place in memory (as for variables), so you don't
really see an array on a page. You can visualize an array as a single-column
list of entries. An entry might be a number, a text string, a Boolean value,
or any other kind of data that JavaScript works with, such as a date object,
a reference to a document's object, or even the name of another array .
Unlike arrays in the BASIC language, JavaScript arrays have only one "column" of data (although you can simulate multidimensional arrays in JavaScript). Also, unlike constructions of this nature in other languages (such as C or Java arrays), JavaScript's loose data typing means that an array is not restricted to storing data of only one type. For example, the same array can store a number in one slot, a string in another, three Booleans scattered about, and a document object reference if that's what the script design requires. And, just as with JavaScript variables, you can change the type of data in a slot of an array as you see fit.
The true power, however, comes in the way scripts enter and retrieve items in arrays. The default behavior of an array automatically assigns a number (called an index) to each entry added to an array. The number simply designates which slot in the array a piece of data currently occupies. This numbering system begins with 0: the first slot of an array occupies slot number 0, the second slot is number 1, and so on. Index numbers make it easy for scripts to look through entries of an array to see if a particular value is there.
(from devloper.netscape.com)