对象深拷贝

const deepCopy = (obj)=>{
  const newObj = {};
  for (const i in obj) {
    newObj[i] = typeof obj[i] === "object" ? deepCopy(obj[i]) : obj[i];
  }
}

 

posted @ 2022-04-14 15:25  打代码的侠义豪情  阅读(15)  评论(0)    收藏  举报