function deepClone(obj = {}) {// 如果是不需要克隆的类型直接返回if(typeof obj !== 'object' || obj === null) {return obj}// 根据是数组or对象初始化结果值let resultif(obj instanceof Array) {result = []} else {result = {}}// 递归拷贝for(key of obj) {result[key] = deepClone(obj[key])}return result}
