title: Trying to understand logical operator (a && a === b && a === C) Used in React JS sample
body: <p>Can someone kindly, explain what the above return with example.
  And what happen when you change it to ( a === b ===C).
  Have been trying to understand that logic better in reactjs.org, although working well but how the logic works still not clear in my mind</p>
  
  <p>Sample code copied from React tutorial</p>
  
  <p>`</p>
  
  <pre><code>function calculateWinner(squares) {
      const lines = [
          [0, 1, 2],
          [3, 4, 5],
          [6, 7, 8],
          [0, 3, 6],
          [1, 4, 7],
          [2, 5, 8],
          [0, 4, 8],
          [2, 4, 6],
      ];
      //alert(lines.length);
      for (let i = 0; i &lt; lines.length; i++) {
          const [a, b, c] = lines[i];
          //alert(squares[a]);
          if (squares[a] &amp;&amp; squares[a] === squares[b] &amp;&amp; squares[a] === squares[c]) {
              return squares[a];
          }
      }
      return null;
  }
  </code></pre>
  
  <p>`</p>
  
  <p>From ReactJS.org
   <a href="https://reactjs.org/tutorial/tutorial.html" rel="nofollow noreferrer">https://reactjs.org/tutorial/tutorial.html</a></p>