Web APIs

Structured clone transfer list

Try the free JavaScript compiler

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

NameTypeDescription
valueAnyCloneable value.
optionsObjectContains 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);
JavaScript Reference