Transferable objects
Transferable objects allow ownership of a resource such as an ArrayBuffer to move between contexts without copying the buffer contents.
What it is
Transferable objects allow ownership of a resource such as an ArrayBuffer to move between contexts without copying the buffer contents.
Why it matters
Transferring a buffer hands it over: the sender cannot keep using it as if it still owned the data.
Example
worker.postMessage({buffer}, [buffer]) transfers an ArrayBuffer; the sender buffer becomes detached.
Technical detail
The transfer list names resources to transfer, but the message must also expose those resources to the receiver.
When to use it
Use transfer for large one-way payloads and reuse buffers deliberately to avoid allocation churn.
Sources
More in Web platform
Assembled from the ReLU.chat curated knowledge base. These explanations are concise on purpose; check the sources for anything important.