I am having a slight problem with assigning objects in javascript.
take a look at this sample code that reproduces my problem.
var fruit = { name: "Apple" }; var vegetable = fruit; vegetable.name = "potatoe"; console.log(fruit);
he writes
Object {name: "potatoe"}
How can I assign a value to not an object reference to another object?
javascript variable-assignment
Mubashar abbas
source share