/**
* 深度拷贝对象
* @param obj
* @returns {*}
*/
const myDeepCopy = function (obj) {
if (typeof obj !== 'object') {
return obj
}
let newObj = {}
for (let attr in obj) {
newObj[attr] = myDeepCopy(obj[attr])
}
return newObj
}
/**
* 深度拷贝对象
* @param obj
* @returns {*}
*/
const myDeepCopy = function (obj) {
if (typeof obj !== 'object') {
return obj
}
let newObj = {}
for (let attr in obj) {
newObj[attr] = myDeepCopy(obj[attr])
}
return newObj
}