dailyCode

a&b 赋值问题

2019-2-18

var a = { n: 1 }
var b = a
a.x = a = { n: 2 }

Q&A

undefined, { n: 2 }
{n:1,x:{n:2,x:{n:1,.....}} // 一直循环下去