title: Why changing the "if" condition give different answers when I use === instead of !==?
body: <p><strong>The function checks if array elements are same, if they are same it should return true.</strong></p>
  
  <p>When I use the function below, it gives the correct result.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var arr = [1, 2, 3, 4];
  
  function isUniform(arr) {
    var store = arr[0];
  
    for (var i = 0; i &lt; arr.length; i++) {
      if (arr[i] !== store) {
        return false;
      }
    }
    return true;
  }
  console.log(isUniform(arr));</code></pre>
  </div>
  </div>
  </p>
  
  <p>But when I use the function like this i.e; <strong>changing the <em>if</em> condition</strong>, it returns false</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var arr = [1, 2, 3, 4];
  
  function isUniform(arr) {
    var store = arr[0];
  
    for (var i = 0; i &lt; arr.length; i++) {
      if (arr[i] === store) {
        return true;
      }
    }
    return false;
  
  }
  
  console.log(isUniform(arr));</code></pre>
  </div>
  </div>
  </p>