Skip to content

Commit 51fc96d

Browse files
committed
Fix incorrect description of array.length assignment.
1 parent 348f2e2 commit 51fc96d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/en/array/general.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ elements that are contained in the array, the *setter* can be used to
4545
foo; // [1, 2, 3]
4646

4747
foo.length = 6;
48-
foo; // [1, 2, 3]
48+
foo.push(4);
49+
foo; // [1, 2, 3, undefined, undefined, undefined, 4]
4950

50-
Assigning a smaller length does truncate the array, but increasing the length
51-
does not have any effect on the array.
51+
Assigning a smaller length truncates the array. Increasing it creates a sparse array.
5252

5353
### In Conclusion
5454

0 commit comments

Comments
 (0)