javascript console.log給人混淆的結果。我執行了代碼。javascript console.log不能按預期工作?
var obj = {a: {b: {c: {}}}};
console.log(obj);
obj.a.b.c.name = "rafael";
然後我看看控制檯窗口並展開對象。這是
Object{a: {b: {c: {name: "sohan"}}}}
但我希望它是
Object{a: {b: {c: {}}}}
爲什麼這混亂的行爲?
這是在這裏覆蓋:http://stackoverflow.com/questions/7389069/console-log-object-at-current-state – TMG