0
一些我不下面的代码片段获取: a和b是现在会指向同一个对象。分配顺序
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
在上次赋值中,属性x被添加到条上。 为什么?不应该指向n:2?
如果我跑这是在Chrome脚本,看来酒吧拥有新的属性。 FOO:对象 N:2 栏:对象 N:1 X:对象 foo.x:未定义 – badigard