|Top Previous Next|
Gets or sets the number of elements in the array.
The number of elements in the array.
If you assign a new value to length, the array will grow or shrink if needed. Any new elements created will be initialized to the value undefined. Any elements that had an index greater than or equal to the new length will be discarded.
var ary, res;
ary = Array(1,true,"test");
ary.length = 2;