How do I do the following whilst protecting the state of 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
I realize that this works...
var a = function(o){
this.o = {};
this.o.one = o.one;
this.o.one = 'three';
}
...
but what if I would like to 'import' the whole object?
EDIT
This is answered here -> JavaScript: How to pass object by value?
Thanks everyone!