structuredClone
Description
The structuredClone of WindowOrWorkerGlobalScope for JS takes the input value and returns a deep copy by performing the structured clone algorithm. Transferable objects listed in the transfer array are transferred, not just cloned, meaning that they are no longer usable in the input value.
Throws a "DataCloneError" DOMException if any part of the input value is not serializable.
Syntax
result = self.structuredClone(value [, options ])
Parameters
value
A string.
options
Allows setting transfer.
transfer
Transfers the object.