title: JSlint: redefinition of i inside of function scope
body: <p>When running the following Javascript code through JSLint:</p>
  
  <pre><code>    (function () {
          var i = 'a';
  
          console.log(i);
  
          function foo () {
              var i = 'b';
              console.log(i);
          }
  
          foo();
  
          console.log(i);
  
          foo();
      }());
  </code></pre>
  
  <p>I get the following errors in JSLint:</p>
  
  <pre><code>    #1 Redefinition of 'i' from line 4.
         var i = 'b'; // Line 7, Pos 13
      #2 Unused 'i'.
         var i = 'a'; // Line 4, Pos 9
      #3 Unused 'foo'.
          function foo () { // Line 6, Pos 14
  </code></pre>
  
  <p>My questions:</p>
  
  <ol>
  <li><p>Why does it say foo() is unused when I am clearly calling it?</p></li>
  <li><p>Why does it say the function-scoped <code>var i = 'b'</code> is a redefinition of the one above it</p></li>
  <li><p>Why does it say that the first <code>var i = 'a'</code> definition goes unused?</p></li>
  </ol>