Compare Revisions

Array.prototype.length

Change Revisions

Revision 477585:

Revision 477585 by LouisLazaris on

Revision 483049:

Revision 483049 by michaelficarra 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 477585
Revision 483049
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 additional elements are set to <cod>e>length</code> property, the number of actual elements does not 
>e>undefined</code>; for example, if you set <code>length</code> t>increase; for example, if you set <code>length</code> to 3 when i
>5 when it is currently 2, the array will contain 2 defined elem>t is currently 2, the array still contains only 2 elements. &nbsp
>ents along with 3 additional elements with values of <code>undefi>;<span style="line-height: 1.572;">Thus, the&nbsp;</span><code st
>ned</code>. &nbsp;<span style="line-height: 1.572;">Thus, the&nbs>yle="font-size: 14px;">length</code><span style="line-height: 1.5
>p;</span><code style="font-size: 14px;">length</code><span style=>72;">&nbsp;property says nothing about the number of defined valu
>"line-height: 1.572;">&nbsp;property says nothing about the numbe>es in the array.&nbsp;</span><span style="line-height: 1.572;">Se
>r of defined values in the array.&nbsp;</span><span style="line-h>e also&nbsp;</span><a href="/en-US/docs/Web/JavaScript/Reference/
>eight: 1.572;">See also&nbsp;</span><a href="/en-US/docs/Web/Java>Global_Objects/Array#Relationship_between_length_and_numerical_pr
>Script/Reference/Global_Objects/Array#Relationship_between_length>operties" style="line-height: 1.572;" title="Relationship between
>_and_numerical_properties" style="line-height: 1.572;" title="Rel> length and numerical properties">Relationship between length and
>ationship between length and numerical properties">Relationship b> numerical properties</a><span style="line-height: 1.572;">.</spa
>etween length and numerical properties</a><span style="line-heigh>n>
>t: 1.572;">.</span> 

Back to History