Easy Tutorial
❮ Met Document Adoptnode Jsref Includes ❯

JavaScript length Property

JavaScript Array Object

Example

Returns the number of elements in an array:

The result could be


Definition and Usage

The length property sets or returns the number of elements in an array.


Browser Support

All major browsers support the length property.


Syntax

Set the number of elements in an array:

Return the length of an array:

Technical Details

Return Value: A number, representing the number of elements in the array.
JavaScript Version: 1.1
--- ---

❮ Met Document Adoptnode Jsref Includes ❯