浏览器新增深拷贝方法structuredClone

101 阅读1分钟
let arr = [{a:1,b:2}]
let arr2 = structuredClone(arr)
// arr2 是个深拷贝对象

structuredClone(arr)

会得到一个新的新拷贝对象。