title: Why doesn't my game's checkWinner function work as expected?
body: <p>I've built the TicTacToe game to the part where I can put in "X" and "O", in react.js, but there's problem with certain part of code. When I try to make winning condition with function checkWinner(), problem is that noting happens i can just can go on with clicking, but it should have acted on alert function and show message 'You won'.</p>
  
  <p>I do the following:</p>
  
  <pre><code>function checkWinner() {
    let winLines = [
      ["0", "1", "2"],
  
      ["3", "4", "5"],
  
      ["6", "7", "8"],
  
      ["0", "3", "6"],
  
      ["1", "4", "7"],
  
      ["2", "5", "8"],
  
      ["0", "4", "8"],
  
      ["2", "4", "6"]
    ];
  
    for (let index = 0; index &lt; winLines.length; index++) {
      const [a, b, c] = winLines[index];
  
      if (
        this.state.board[a] &amp;&amp;
        this.state.board[a] === this.state.board[b] &amp;&amp;
        this.state.board[a] === this.state.board[c]
      ) {
        alert("You won");
  
        this.setState({
          winner: this.state.player
        });
      }
    }
  }
  
  </code></pre>
  
  <p>I looked in code and i just don't see any problem, so i would appreciate any help because this is getting frustrating.</p>