title: JavaScript "for (var i = 0; ...) { ... }" browser incompatibilities?
body: <p>I haven't done serious JavaScript programming in a while, and I am writing an intro guide to the language for some of my colleagues. I'd like to discuss loop best practices, but there is one small detail I've kept in the back of my head:</p>
  
  <p>When looping over arrays, I remember the following pattern not being safe to use because there are major browsers that don't support it: </p>
  
  <pre><code>for (var i = 0; i &lt; ls.length; i++) { ... }
  </code></pre>
  
  <p>Instead, the var keyword must be moved out of the array, as such:</p>
  
  <pre><code>var i;
  for (i = 0; i &lt; ls.length; i++) { ... }
  </code></pre>
  
  <p>Is this correct? I've scoured the net and cannot confirm this. Do some old browsers not support the first method? If not, which ones do not?</p>