title: Difference between a basic for-loop and a for-in-loop in JavaScript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/500504/javascript-for-in-with-arrays">JavaScript &ldquo;For &hellip;in&rdquo; with Arrays</a>  </p>
  </blockquote>
  
  
  
  <p>In which situations using</p>
  
  <pre><code>for (var i = 0; i &lt; array.length; i++)
  </code></pre>
  
  <p>is different from using</p>
  
  <pre><code>for (var i in array)
  </code></pre>
  
  <p>in JavaScript?</p>