var a = {n:1}; var b = a;
a.x = a = {n:2}
console.log(a.x) // undefined console.log(b.x) //{n: 2}
从指针角度解释
第一步:
第二步:
第三步:
第四步:
https://www.cnblogs.com/joesbell/p/6229423.html
var a = {n:1}; var b = a;
a.x = a = {n:2}
console.log(a.x) // undefined console.log(b.x) //{n: 2}
从指针角度解释
第一步:
第二步:
第三步:
第四步:
https://www.cnblogs.com/joesbell/p/6229423.html