javascript object deep clone code example
Example 1: clone javascript object
let clone = Object.assign({}, objToClone);
Example 2: javascript deep clone
var cloned = JSON.parse(JSON.stringify(objectToClone));
Example 3: how to make a deep copy in javascript
JSON.parse(JSON.stringify(o))