The length property sets or returns the number of elements in an array.
![]()
The length property is supported in all major browsers.
Set the length of an array:
Return the length of an array:
| Return Value: | A Number, representing the number of elements in the array object |
|---|---|
| JavaScript Version: | 1.1 |
JavaScript Array Object
Your message has been sent to W3Schools.