Skip to content

Commit 664877a

Browse files
committed
Avoid i++ in array spreads example
This style guide recommends using `i += 1` over `i++`. Even though this appears in a "bad" example, the example will be clearest if it is "bad" in fewer ways.
1 parent 54aa8f1 commit 664877a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Other Style Guides
350350
const itemsCopy = [];
351351
let i;
352352
353-
for (i = 0; i < len; i++) {
353+
for (i = 0; i < len; i += 1) {
354354
itemsCopy[i] = items[i];
355355
}
356356
@@ -565,7 +565,7 @@ Other Style Guides
565565

566566
// good
567567
const foo = '\'this\' is "quoted"';
568-
const foo = `my name is '${name}'`;
568+
const foo = `my name is '${name}'`;
569569
```
570570
571571
**[⬆ back to top](#table-of-contents)**

0 commit comments

Comments
 (0)