Skip to content

Commit cc776ea

Browse files
committed
language clean up
1 parent 7e5c101 commit cc776ea

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

doc/en/array/constructor.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## The `Array` Constructor
22

33
Since the `Array` constructor is ambiguous in how it deals with its parameters,
4-
it is highly recommended to always use the array literals - `[]` notation -
4+
it is highly recommended to use the array literal - `[]` notation -
55
when creating new arrays.
66

77
[1, 2, 3]; // Result: [1, 2, 3]
@@ -22,14 +22,12 @@ the actual indexes of the array will not be initialized.
2222
1 in arr; // false, the index was not set
2323

2424
Being able to set the length of the array in advance is only useful in a few
25-
cases, like repeating a string, in which it avoids the use of a `for loop`
26-
code.
25+
cases, like repeating a string, in which it avoids the use of a loop.
2726

2827
new Array(count + 1).join(stringToRepeat);
2928

3029
### In Conclusion
3130

32-
The use of the `Array` constructor should be avoided. Literals are definitely
33-
preferred. They are shorter, have a clearer syntax, and increase code
31+
Literals are preferred to the Array constructor. They are shorter, have a clearer syntax, and increase code
3432
readability.
3533

0 commit comments

Comments
 (0)