title: Does javascript implement lexical scoping?
body: <p>Why does this return 2 instead of 1? Seems the second "var" is silently ignored.</p>
  
  <pre class="lang-js prettyprint-override"><code>function foo()
  {
    var local = 1;
    {
      var local = 2;
    }
    return local;
  }
  foo()
  /*
  2
  */
  </code></pre>