如果 javascript 对象是通过引用分配的,那么第二个 console.log 不应该显示 obj2 = {c:3}
let obj1 = {a:1}
let obj2 = {b:2}
obj2 = obj1
console.log(obj2) // {a:1}
obj1 = {c:3}
console.log(obj2) // still {a:1}
繁华开满天机
杨__羊羊
相关分类