I am trying to create a copy of object a, without having to manually enter its property's into object b. In this code, b simply refers to a. I want to create a new version of a, so that when I add a property to b, it is not visible through a.
var a = new Object(); // create an empty object
var b = a; // now b refers to the same object
b.test = 1; // add a new property to b
alert(a.test); // => 1: the new property is also visible through a
a === b; // => true: a and b refer to the same object