I have an array of objects that is an input. Lets call it content.
content
When trying to deep copy it, it still has a reference to the previous array.
Here is my own. Doesn't work for complex cases, but for a simple array of Objects, it's good enough.
deepClone(oldArray: Object[]) { let newArray: any = []; oldArray.forEach((item) => { newArray.push(Object.assign({}, item)); }); return newArray; }