What does this refer to and why?
<p>In this example:</p>

<pre><code>var A = {test: 1, foo: function() { return this.test }}
</code></pre>

<p>Why <code>A.foo()</code> returns <code>1</code> (at least in node.js)? I thought <code>this</code> will be bound to external caller <code>this</code>, no?</p>
