ArrayBuffer.prototype.detached

Baseline 2024
Newly available

Since March 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The detached accessor property of ArrayBuffer instances returns a boolean indicating whether or not this buffer has been detached (transferred).

Description

The detached property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is false when the ArrayBuffer is first created. The value becomes true if the ArrayBuffer is transferred, which detaches the instance from its underlying memory. Once a buffer becomes detached, it is no longer usable.

Examples

Using detached

js
const buffer = new ArrayBuffer(8);
console.log(buffer.detached); // false
const newBuffer = buffer.transfer();
console.log(buffer.detached); // true
console.log(newBuffer.detached); // false

Specifications

Specification
ECMAScript® 2027 Language Specification
# sec-get-arraybuffer.prototype.detached

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
detached
Chrome – Full support
Chrome 114 (Release date: 2023-05-30)
footnote Full support
Edge – Full support
Edge 114 (Release date: 2023-06-02)
footnote Full support
Firefox – Full support
Firefox 122 (Release date: 2024-01-23)
footnote Full support
Opera – Full support
Opera 100 (Release date: 2023-06-29)
footnote Full support
Safari – Full support
Safari 17.4 (Release date: 2024-03-05)
footnote Full support
Chrome Android – Full support
Chrome Android 114 (Release date: 2023-05-30)
footnote Full support
Firefox for Android – Full support
Firefox for Android 122 (Release date: 2024-01-23)
footnote Full support
Opera Android – Full support
Opera Android 76 (Release date: 2023-06-26)
footnote Full support
Safari on iOS – Full support
Safari on iOS 17.4 (Release date: 2024-03-05)
footnote Full support
Samsung Internet – Full support
Samsung Internet 23 (Release date: 2023-10-18)
footnote Full support
WebView Android – Full support
WebView Android 114 (Release date: 2023-05-30)
footnote Full support
WebView on iOS – Full support
WebView on iOS 17.4 (Release date: 2024-03-05)
footnote Full support
Bun – Full support
Bun 1.0.19 (Release date: 2023-12-22)
footnote Full support
Deno – Full support
Deno 1.33 (Release date: 2023-04-28)
footnote Full support
Node.js – Full support
Node.js 21 (Release date: 2023-10-17)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also