🔸array length
JS ⟩ object ⟩ built-in ⟩ Array ⟩ length
array length is automatically maintained by the array.
if you assign
a[i] = value
, where i ≥ a.length, a.length is set toi+1
.if you set
a.length = n
, where n < a.length, then any elements whose index ≥ n are deleted.
Last updated