title: Why doesn't the outer scope variable get properly bound to the inner variable?
body: <pre><code>(function(){
    var x = 23;
    return function(){
      var x = x;
      return x;
    }
  }())();
  </code></pre>
  
  <p>Why does it return undefined instead of 23?</p>
  
  <p>Shouldn't the var x = x; part be sufficiently unambiguous because the right hand side implicitly refers to the x in the outer scope?</p>