function shallowClone(obj) { return $.extend({}, obj); }
function deepClone(obj) { return $.extend(true, {}, obj); }
function clone(obj) { // A reasonable default return deepClone(obj); }Example use:
let newObj = clone(oldObj);
function shallowClone(obj) { return $.extend({}, obj); }
function deepClone(obj) { return $.extend(true, {}, obj); }
function clone(obj) { // A reasonable default return deepClone(obj); }Example use:
let newObj = clone(oldObj);