I tried copying a JSON variable to another variable and then deleting part of the content of the second variable, however the content from the first variable was also deleted.
How can I make it that I delete the part of the second variable but not the part from the first variable?
Thank you for every help!!
var variable1 = {
test1 : "test1",
test2 : "test2"
}
var variable2 = variable1;
variable2.test1 = "";
console.log(JSON.stringify(variable1));
console.log(JSON.stringify(variable2));