jsonjs.js
function deepClone(obj) {
  if (obj == null || typeof obj !== 'object') {
    return obj;
  }
  var cloned = obj.constructor();
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      cloned[key] = deepClone(obj[key]);
    }
  }
  return cloned;
}
function deepClone(obj) {
  if (obj == null || typeof obj !== 'object') {
    return obj;
  }
  var cloned = obj.constructor();
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      cloned[key] = deepClone(obj[key]);
    }
  }
  return cloned;
}
Deep clone an object
@param {object} obj
@returns {object}