I want to set object a equal to object b and then edit property x from object a. But, when I edit a.x, b.x gets changed too for some reason. How do I work around this?
var b = {
x: 0,
y: 3
};
var a = b;
alert(b.x); //outputs 0
a.x = 1;
alert(b.x); //outputs 1?