global.structuredClone
Deep copy with cycles; functions and symbols throw a DataCloneError. No transfer.
Usage
Copy plain application data before editing a draft.
// Copy plain application data before editing a draft.
const saved = { title: 'Packing list', items: ['Passport'] };
const draft = structuredClone(saved);
draft.items.push('Tickets');
console.log(saved.items.length, draft.items.length); // 1, 2Signatures
<T>(value: T): TType parameters
| Name | Constraint | Default |
|---|---|---|
T | — | — |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
value | T | Yes | — |
Returns
T
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.