byteLength
accessor property represents the length of an
SharedArrayBuffer
in bytes.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
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.
var sab = new SharedArrayBuffer(1024); sab.byteLength; // 1024
| 规范 |
|---|
|
ECMAScript (ECMA-262)
The definition of 'SharedArrayBuffer.prototype.byteLength' in that specification. |
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
byteLength
|
Chrome
68
|
Edge
79
|
Firefox
79
|
IE No | Opera No | Safari 10.1 — 11 |
WebView Android
60 — 63
|
Chrome Android
60 — 63
|
Firefox Android
57
Disabled
|
Opera Android No | Safari iOS 10.3 — 11 |
Samsung Internet Android
No
|
nodejs 8.10.0 |
完整支持
不支持
见实现注意事项。
用户必须明确启用此特征。
SharedArrayBuffer
SharedArrayBuffer.prototype.byteLength
Function
Object
Object.prototype.__defineGetter__()
Object.prototype.__defineSetter__()
Object.prototype.__lookupGetter__()
Object.prototype.__lookupSetter__()
Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toSource()
Object.prototype.toString()
Object.prototype.valueOf()
Object.setPrototypeOf()