Why is the value of foo.x undefined in foo.x = foo = {n: 2}?
<p>This code:</p>

<pre><code>var foo = {n: 1};
var bar = foo;
foo.x = foo = {n: 2};
</code></pre>

<p>Can you please explain what is meant by:</p>

<pre><code>foo.x = foo = {n: 2};
</code></pre>

<p>I see that <code>{n:2}</code> is assigned to <code>foo</code>. Why is <code>undefined</code> assigned to <code>foo.x</code>? Does <code>foo = {n: 2};</code> return <code>undefined</code>?</p>