Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
If you make the length property smaller than its previous value, the array is truncated, and any elements with array indexes equal to or greater than the new value of the length property are lost.
If you make the length property larger than its previous value, the array is expanded, and any new elements created have the value undefined.
The following example illustrates the use of the length property:
Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.
Starting with Internet Explorer 9 Standards mode, trailing commas included in the initialization of an Array are handled differently.