title: Declaring var inside Javascript for loop declaration
body: <p>I'm sure I've read a discussion on SO about this but can't find it. Simply, are there cons to declaring a for loop's increment inside the loop's declaration? What is the difference between this:</p>
  
  <pre><code>function foo() {
      for (var i=0; i&lt;7; i++) {
          // code
      }
  }
  </code></pre>
  
  <p>...and this:</p>
  
  <pre><code>function foo() {
      var i;
      for (i=0; i&lt;7; i++) {
          // code
      }
  }
  </code></pre>
  
  <p>Since JS has function scope, either should be fine, right? Are there edge cases where the former approach would cause problems?</p>
  
  <p>If they are identical, why is Crockford/JSLint all, "No way dawg," about it?</p>