|
@ -386,8 +386,8 @@ Its `handleClick` can push a new entry onto the stack by concatenating the new h |
|
|
|
|
|
|
|
|
```javascript |
|
|
```javascript |
|
|
handleClick(i) { |
|
|
handleClick(i) { |
|
|
var history = this.state.history; |
|
|
const history = this.state.history; |
|
|
var current = history[history.length - 1]; |
|
|
const current = history[history.length - 1]; |
|
|
const squares = current.squares.slice(); |
|
|
const squares = current.squares.slice(); |
|
|
if (calculateWinner(squares) || squares[i]) { |
|
|
if (calculateWinner(squares) || squares[i]) { |
|
|
return; |
|
|
return; |
|
|