title: Array max value function gives unexpected result
body: <p>I have this function for returning the maximum value of an array:</p>
  
  <pre><code>Array.prototype.max = function() {
  
  var max = this[0];
  var len = this.length;
  
  for (var i = 1; i &lt; len; i++)
  {
  
      if (this[i] &gt; max)
      {       
          max = this[i];
      }
  }
  
      return max;
  }
  </code></pre>
  
  <p>When I use this array:</p>
  
  <pre><code>var data1Values = ['0','0','0','0','3','0','6','12']
  </code></pre>
  
  <p><code>data1Values.max()</code> returns 6 instead of 12. It somehow skips the last value.</p>
  
  <p>I've inserted <code>alert(this[i])</code> and <code>alert(max)</code> inside the loop, and it recognizes both values (12 as <code>this[i]</code> and 6 as <code>max</code>) but it wont enter the condition.</p>
  
  <p>What is happening here ?</p>