Professional Documents
Culture Documents
But quite often we find that we need an ordered collection, where we have a 1st, a
2nd, a 3rd element and so on. For example, we need that to store a list of
something: users, goods, HTML elements etc.
There exists a special data structure named Array, to store ordered collections.
Declaration
There are two syntaxes for creating an empty array:
alert( fruits.length ); // 3
We can also use alert to show the whole array.