const myDeepCopy = structuredClone(myOriginal);- It can handle cyclic data.
- Functions will be discarded just like JSON.parse(JSON.stringify())
name MDN structured clone
type link
action https://developer.mozilla.org/en-US/docs/Web/API/structuredCloneconst myDeepCopy = structuredClone(myOriginal);name MDN structured clone
type link
action https://developer.mozilla.org/en-US/docs/Web/API/structuredClone