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.
This commit is contained in:
Joe Lencioni
2016-12-01 09:11:00 -08:00
parent 54aa8f1b35
commit 664877a601

View File

@@ -350,7 +350,7 @@ Other Style Guides
const itemsCopy = [];
let i;
for (i = 0; i < len; i++) {
for (i = 0; i < len; i += 1) {
itemsCopy[i] = items[i];
}
@@ -565,7 +565,7 @@ Other Style Guides
// good
const foo = '\'this\' is "quoted"';
const foo = `my name is '${name}'`;
const foo = `my name is '${name}'`;
```
**[⬆ back to top](#table-of-contents)**