The byteLength
accessor property represents the length of an SharedArrayBuffer
in bytes.
Syntax
sab.byteLength
Description
The byteLength
property is an accessor property whose set accessor function is undefined
, meaning that you can only read this property. The value is established when the shared array is constructed and cannot be changed.
Examples
var sab = new SharedArrayBuffer(1024); sab.byteLength; // 1024
Specifications
Specification | Status | Comment |
---|---|---|
ECMAScript Latest Draft (ECMA-262) The definition of 'SharedArrayBuffer.prototype.byteLength' in that specification. |
Living Standard | Initial definition in ES2017. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 60 | 16 | 55 46 — 541 | No | No | 10.1 |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic support | 60 | 60 | ? | 55 46 — 541 | No | No | No |
1. From version 46 until version 54 (exclusive): this feature is behind the javascript.options.shared_memory
preference (needs to be set to true
). To change preferences in Firefox, visit about:config.
See also
Document Tags and Contributors
Tags:
Contributors to this page:
fscholz,
chrisdavidmills
Last updated by:
fscholz,