jquery clone object deep code example
Example 1: clone javascript object
let clone = Object.assign({}, objToClone);
Example 2: how to make a deep copy in javascript
JSON.parse(JSON.stringify(o))
Example 3: jquery clone object
// Shallow copy
var newObject = jQuery.extend({}, oldObject);
// Deep copy
var newObject = jQuery.extend(true, {}, oldObject);