jsのオブジェクトタイプ

271 ワード

var a = {name: 1};
var b = a;
console.log(a);
console.log(b);
    :
{ name: 1 }
{ name: 1 }
b.name = 2;
console.log(a);
console.log(b);
    :
{ name: 2 }
{ name: 2 }
var b = {name: 3};
console.log(a);
console.log(b);
    :
{ name: 2 }
{ name: 3 }