File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,15 @@ the actual indexes of the array will not be initialized.
2121 arr[1]; // undefined
2222 1 in arr; // false, the index was not set
2323
24- The behavior of being able to set the length of the array upfront only comes in
25- handy in a few cases, like repeating a string, in which it avoids the use of a
26- ` for loop ` code.
24+ 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.
2727
2828 new Array(count + 1).join(stringToRepeat);
2929
3030### In Conclusion
3131
32- The use of the ` Array ` constructor should be avoided as much as possible.
33- Literals are definitely preferred. They are shorter and have a clearer syntax;
34- therefore, they also increase the readability of the code .
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
34+ readability.
3535
You can’t perform that action at this time.
0 commit comments