Here are two objects named primary
and secondary
:
var primary = {"gonna":3,"lol":114,"wouldn":2,"know":6,"lowkey":2,"man":5};
var secondary = primary;
When I use delete secondary['lol'];
it deletes the property from both objects: jsfiddle
My question is: how to delete a property from secondary
without deleting it from primary
?