function A(){}
var B = {};
var a1 = new A();
var a2 = new A();
var b1 = B;
var b2 = b1;
A.prototype.prop = "A's Property";
b1.prop = "B's Property";
a1.prop = "Not Prop";
alert (a1.prop + " not equal to " + a2.prop);
b2.prop = "Not Prop";
alert (b1.prop +" still equal to "+ b2.prop);
As you can see, b2.prop can’t pass by value, how to pass by value without changing the property name?
Define a clone method:
and then use it to clone your
b1object: