I am copying myObj to tempMyObj
myObj
tempMyObj
var tempMyObj = myObj;
tempMyObj.entity is an array of objects. I am
tempMyObj.entity
deep clone object with JSON.parse() and JSON.stringify
// Deep Clone obj = { a: 0 , b: { c: 0}}; let deepClone = JSON.parse(JSON.stringify(obj));
refrence: this article