title: What's the fastest way to loop through an array in JavaScript?
body: <p>I learned from books that you should write for loop like this：</p>
  
  <pre><code>for(var i=0, len=arr.length; i &lt; len; i++){
      // blah blah
  }
  </code></pre>
  
  <p>so the <code>arr.length</code> will not be calculated each time.  </p>
  
  <p>Others say that the compiler will do some optimization to this, so you can just write:  </p>
  
  <pre><code>for(var i=0; i &lt; arr.length; i++){
      // blah blah
  }
  </code></pre>
  
  <p>I just want to know which is the best way in practice? </p>