Skip to content

Commit 5a745d5

Browse files
jonrandyJosh-Cena
andauthored
Update description of Array.length property (#43981)
* Update description of Array.length property Clarified the definition of the 'length' property to indicate it represents the number of slots in the array, accounting for sparse arrays. * Update files/en-us/web/javascript/reference/global_objects/array/length/index.md Co-authored-by: Joshua Chen <sidachen2003@gmail.com> --------- Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
1 parent 7aba7d7 commit 5a745d5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • files/en-us/web/javascript/reference/global_objects/array/length

files/en-us/web/javascript/reference/global_objects/array/length/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ browser-compat: javascript.builtins.Array.length
77
sidebar: jsref
88
---
99

10-
The **`length`** data property of an {{jsxref("Array")}} instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array.
10+
The **`length`** data property of an {{jsxref("Array")}} instance represents the number of slots in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. It may be greater than the number of elements if the array is [sparse](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#array_methods_and_empty_slots).
1111

1212
{{InteractiveExample("JavaScript Demo: Array: length", "shorter")}}
1313

0 commit comments

Comments
 (0)