How do i make a copy of an object? Javascript
<p>I have a class in json format. I would like to make two instance. Right now (its pretty obvious why) when i 'make' two objects i really have 2 vars pointing to one. (b.blah = 'z' will make a.blah=='z')</p>

<p>How do i make a copy of an object?</p>

<pre><code>var template = {
    blah: 0,
    init: function (storageObj) {
        blah = storageObj;
        return this; //problem here
    },
    func2: function (tagElement) {
    },
}

a = template.init($('form [name=data]').eq(0));
b = template.init($('form [name=data2]').eq(0));
</code></pre>
