bの状態を保護しながら次のことを行うにはどうすればよいですか?
var a = function(o){
this.o = o;
this.o.one = 'three';
}
var b = {'one':'two'};
var c = new a(b);
console.log(b.one); //three
私はこれが機能することを理解しています...
var a = function(o){
this.o = {};
this.o.one = o.one;
this.o.one = 'three';
}
...
しかし、オブジェクト全体を「インポート」したい場合はどうすればよいでしょうか?
編集
これはここで回答されています-> JavaScript:オブジェクトを値で渡す方法は?
みんな、ありがとう!