Web APIs
Structured clone transfer list
Host structured clone option moves transferable resources; transferred ArrayBuffer is detached in source. Not an ECMAScript built-in operation.
Formal Syntax & Structure
javascript syntaxjavascript
structuredClone(value, {transfer: [buffer]})Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| value | Any | Cloneable value. |
| options | Object | Contains transfer array. |
Return Value
Any
Cloned value with transferred resources.
Working Example
Example Snippetjavascript
const b=new ArrayBuffer(4);const c=structuredClone(b,{transfer:[b]});console.log(b.byteLength,c.byteLength);