Use `const` instead of `var` (#8107)
It clarifies that `history` and `current` won't be reassigned.
Lutz Rosema committed
Oct 26, 2016 at 16:20 UTC
42465eefed237221c02eeebb1f0f7e3810bfd672
1 file changed
+2
-2
docs/tutorial/tutorial.md
+2
-2
@@ -386,8 +386,8 @@ Its `handleClick` can push a new entry onto the stack by concatenating the new h
386
387
```javascript
388
handleClick(i) {
389
- var history = this.state.history;
390
- var current = history[history.length - 1];
389
+ const history = this.state.history;
390
+ const current = history[history.length - 1];
391
const squares = current.squares.slice();
392
if (calculateWinner(squares) || squares[i]) {
393
return;