Assign value not reference in javascript : <p>I am having a little problem assigning objects in javascript.</p>

<p>take a look at this sample code that reproduces my problem.</p>

<pre><code>var fruit = {
   name: "Apple"
};

var vegetable = fruit;
vegetable.name = "potatoe";
console.log(fruit);
</code></pre>

<p>it logs </p>

<pre><code>Object {name: "potatoe"}
</code></pre>

<p>How can I assign the value not the reference of an object to another object?</p>
