title: for (var i = 0; i < a.length; i++){ vs. for (var i in a){
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5510772/forvar-i-in-aarray-vs-fori-0-iaarray-length-i">for(var i in aArray) VS for(i=0; i&lt;aArray.length; i++)</a>  </p>
  </blockquote>
  
  
  
  <p>Is it safe to assume that these will always do the same thing, and that I should always use the latter?</p>
  
  <p><code>for (var i = 0; i &lt; a.length; i++){</code></p>
  
  <p><code>for (var i in a){</code></p>