function copy(object){
let res = object instanceof Array?[]:{};
for(const [k,v] of Object.entries(object)){
res[k] = typeof v ==='object'?copy(v):v
}
return res
}
03-21
163
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-26
305
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-26
1061
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-22
334
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-21
347
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)