code: function cloneDeep(value) {
    let obj = {};
    switch (typeOf(value)) {
      case 'object':
        for (let key of Object.keys(value)) {
          obj[key] = cloneDeep(value[key]);
        }
        return obj;
      case 'array':
        return value.map(ele => cloneDeep(ele));
      default: {
        return value;
      }
    }
  }
docs: Deeply clone plain objects and arrays. We're only concerned with
  cloning values that are valid in JSON.