transferable object

An object, such as an ArrayBuffer, ImageBitmap or MessagePort, whose memory can be moved to another thread instead of copied.

In more detail

Listing it in postMessage's transfer list hands ownership over almost instantly, whatever its size. The sender's copy becomes detached and unusable, typically showing a length of zero.

Example

worker.postMessage(buffer, [buffer]); // buffer.byteLength is now 0 here

Related terms

Taught in

References