看到一篇有意思的博客,记录下其中的两个例子
var a = {n: 1};
a.x = a = {n: 2};
console.log(a.x);//undefined
var a, b, c, d;
a = b = c = d = {a: 1};
a.x = a = b.y = b = c.z = c = {}
console.log(a, b, c, d);/{},{},{},{a:1,x:{},y:{},z:{}}
参考: http://www.cnblogs.com/zichi/p/4630656.html