Something I don't get in the following snippet: a and b are now pointers to the same object.
var foo = {n:1}; /// foo points to an object
var bar = foo; /// bar point to the same object as foo
foo.x = foo = {n:2}; /// foo is now pointing to a new object
In the last assignment, property x is added to bar. Why? Shouldn't x point to n:2?