📜  如何在javascript代码示例中深度复制对象

📅  最后修改于: 2022-03-11 15:03:13.351000             🧑  作者: Mango

代码示例2
const obj1 = { a: 1, b: 2, c: 3 };
// this converts the object to string so there will be no reference from 
// this first object
const s = JSON.stringify(obj1);

const obj2 = JSON.parse(s);