VK wrote:
Whatever you wanted to know about it but always were affraid to ask.
<http://www.geocities.c om/schools_ring/ArrayAndHash.ht ml>
I think you need to reconsider your comments about array length (my
wrapping of comments):
"var arrayObject = new Array(3); // arrayObject has 3 undefined
// elements"
That misconception has been repeated many times throughout your article.
The ECMA specification does not say that the length property is the
number of elements in the array, it is defined as being numerically
greater than the name of every property whose name is an array index
(which means it will be equal to the largest index plus 1 or greater).
For all practical purposes, it is irrelevant whether:
var x = new Array( 99 );
actually creates an array of 99 elements or not, but it does
explicitly create an array with a length property of 99. And that is
all you can say with certainty.
You appear to have disregarded the extensive conversation logged here
where the above was pointed out in great detail:
<URL:http://groups.google.c om.au/group/comp.lang.javas cript/browse_frm/thread/c12423afa53a28f 8/589d140d9290e7a 9?q=array+lengt h+undefined&rnu m=7&hl=en#589d1 40d9290e7a9>
Other conversations have recently covered similar ground.
An important property not mentioned by your page is that any element
with an index not less than the length will be deleted, so if you have
an array with length 10 and you set it to 1, any element with index of
1 or greater is deleted.
--
Rob