deepcopy javascript object flaviocopes code example
Example 1: javascript deep clone
var cloned = JSON.parse(JSON.stringify(objectToClone));
Example 2: how to make a deep copy in javascript
JSON.parse(JSON.stringify(o))
var cloned = JSON.parse(JSON.stringify(objectToClone));
JSON.parse(JSON.stringify(o))