I have an object that I want to replace.
var obj1 = { x: "a" };
var ref = obj1;
var obj2 = { y: "b" };
obj1 = obj2;
This results in ref
being equivalent to { x: "a" }
, but I want it to get changed as well to point to obj2
to get ref
being equivalent to { y: "b" }
.