From 42465eefed237221c02eeebb1f0f7e3810bfd672 Mon Sep 17 00:00:00 2001 From: Lutz Rosema Date: Wed, 26 Oct 2016 16:20:09 +0200 Subject: [PATCH] Use `const` instead of `var` (#8107) It clarifies that `history` and `current` won't be reassigned. --- docs/tutorial/tutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorial/tutorial.md b/docs/tutorial/tutorial.md index 4cb5438bb5..180ba05ed0 100644 --- a/docs/tutorial/tutorial.md +++ b/docs/tutorial/tutorial.md @@ -386,8 +386,8 @@ Its `handleClick` can push a new entry onto the stack by concatenating the new h ```javascript handleClick(i) { - var history = this.state.history; - var current = history[history.length - 1]; + const history = this.state.history; + const current = history[history.length - 1]; const squares = current.squares.slice(); if (calculateWinner(squares) || squares[i]) { return;