console.log显示的js结构体成员变量的值不正确
var aaaa = { a1: 'a1' , a2: 'a2' , }; var bbbb = aaaa; console.log( "old aaaa: " , aaaa); console.log( "old bbbb: " , bbbb); bbbb.a1 = 'a3' ; console.log( "new aaaa: " , aaaa); console.log( "new bbbb: " , bbbb); |
old aaaa和old bbbb展开看他们的a1已经是新的值了,但是此时还没有赋值