var a={n:1};var b=a;a.x=a={n:2};console.log(a.x);//-->undefinedconsole.log(b.x);//-->[object Object]
var a={n:1}; var b=a; a.x=a={n:2}; console.log(a.x);//-->undefined console.log(b.x);//-->[object Object]