title: Why is it entering the first if statement although the variable is smaller?
body: <p>This is a very simple code part which simply doesn't work. </p>
  
  <p>I'm trying to compare 2 arrays - if <code>a_arr[i]</code> > than <code>b_arr[i]</code> add points to <code>a</code> else add points to <code>b</code>.</p>
  
  <p>and i keep getting the code running into the first if statement although <code>b_arr[i]</code> has a bigger value. </p>
  
  <pre><code>function solve(a_arr, b_arr){
  
      var a = 0;
      var b = 0;
  
      for (var i = 0, len = 3; i &lt; len; i++) {
  
          if (a_arr[i] == b_arr[i]) {
  
          } else {
  
              if (a_arr[i] &gt; b_arr[i]){
                  a++;
              } else {
                  b++;
              }
  
          }
  
      }
  
      var result = [a, b];
      return result;
  }
  </code></pre>