Compare Revisions

Array.length

Revision 455779:

Revision 455779 by chewxy on

Revision 477583:

Revision 477583 by LouisLazaris on

Title:
Array.length
Array.length
Slug:
Web/JavaScript/Reference/Global_Objects/Array/length
Web/JavaScript/Reference/Global_Objects/Array/length
Tags:
"Array"
"Array"
Content:

Revision 455779
Revision 477583
t53      You can set the <code>length</code> property to truncate ant53      You can set the <code>length</code> property to truncate an
> array at any time. When you extend an array by changing its <cod> array at any time. When you extend an array by changing its <cod
>e>length</code> property, the number of actual elements does not >e>length</code> property, the additional elements are set to <cod
>increase; for example, if you set <code>length</code> to 3 when i>e>undefined</code>; for example, if you set <code>length</code> t
>t is currently 2, the array still contains only 2 elements.&nbsp;>5 when it is currently 2, the array will contain 2 defined elem
> Also see <a href="/en-US/docs/Web/JavaScript/Reference/Global_Ob>ents along with 3 additional elements with values of <code>undefi
>jects/Array#Relationship_between_length_and_numerical_properties">ned</code>.&nbsp; Also see <a href="/en-US/docs/Web/JavaScript/Re
> title="Relationship between length and numerical properties">Rel>ference/Global_Objects/Array#Relationship_between_length_and_nume
>ationship between length and numerical properties</a>. The <code>>rical_properties" title="Relationship between length and numerica
>length</code> property says nothing about the number of values in>l properties">Relationship between length and numerical propertie
> the array.>s</a>. The <code>length</code> property says nothing about the nu
 >mber of values in the array.

Back to History