I have an object "a" and would like to duplicate it to "b" When I delete an element in "a" why is "b" also being affected?
var a = {'apple':1,'orange':2,'grapes':3}
var b = a
console.log(a,b)
delete b.apple
console.log(a,b)
Now a and b are the same. I only want the element in b to be deleted. How can I do this