cloneDeep
Creates a deep copy of an object or array.
Recursively clones own enumerable string keys. Date instances are
reconstructed with the same epoch value. Prototype-polluting keys
(__proto__, constructor, prototype) are silently skipped.
Does not handle circular references.
Limitation: symbol-keyed own properties are not copied — only string
keys are processed. Use structuredClone if symbol propagation is required.
Available since v1.9.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
obj | T | The value to clone |
Returns
Section titled “Returns”T — A deep copy of obj
Examples
Section titled “Examples”Clone a nested object
Section titled “Clone a nested object”Creates a deep copy — modifying the clone does not affect the original.
