I have assigned some data to the one object and I want that object in future as it was like the first time. Whenever I do changes for the parent object it is getting reflected in the child object too. How can I solve this? Please give all possible answer for the object, arrays, maps also.
var parentObject = someData;
const childObj = Object.assign({}, parentObject);
I want to change only parent object and I want to keep child object as constant to use in the future.