深度拷贝

const _ = require('lodash');
var obj = [{x:1},{y:2}]; 
console.log(339,_.cloneDeep(obj));

https://www.lodashjs.com/

https://blog.csdn.net/muzidigbig/article/details/140401692
Radash 取代了lodash

https://blog.csdn.net/weixin_45727472/article/details/136991497

   console.log(339,_.cloneDeep(obj));
   console.log(Object.assign(obj))
   console.log([...obj])

  

posted @ 2022-04-12 16:35  小小强学习网  阅读(17)  评论(0编辑  收藏  举报