javascript function scope
<p>Who can explain why result are [20, 20, 10, 10] in this code:</p>

<pre><code>var x = 10;
var foo = {
  x: 20,
  bar: function () {
    var x = 30;
    return this.x;
  }
};

console.log(
  foo.bar(),
  (foo.bar)(),
  (foo.bar = foo.bar)(),
  (foo.bar, foo.bar)()
);
</code></pre>

<p><strong>Links to specification are welcomed</strong></p>
