# 如何实现一个深拷贝

Issue

欢迎在 Issue 中交流与讨论: Issue 203 (opens new window)

const oldJson = { a: 1 }
const newJson = JSON.parse(JSON.stringify(oldJson))
oldJson.a = 2
console.log(oldJson) // {a: 2}
console.log(newJson) // {a: 1}
Last Updated: 1/17/2021, 2:02:56 PM