structuredClone
structuredClone is a global function in JavaScript that provides a way to perform a deep copy of a value. It's designed to handle a wider range of JavaScript data types than the simple JSON.parse(JSON.stringify(value)) method, which is often used for shallow cloning or copying plain objects.
The structuredClone function can correctly clone objects that contain circular references, which would cause JSON.stringify to
When structuredClone encounters a value that cannot be cloned, such as a function or a DOM node,