deepCopy
1.手写深克隆
function copy(data){
let obj = data instanceof Array ? [] : {}
for (const [k,v] of Object.entries(data)) {
obj[k] = typeof v == "object" ? copy(v) : v;
}
return obj
}
function copy(data){
let obj = data instanceof Array ? [] : {}
for (const [k,v] of Object.entries(data)) {
obj[k] = typeof v == "object" ? copy(v) : v;
}
return obj
}
使用社交账号登录