SharedArrayBuffer.prototype.byteLength
byteLength
访问器属性表示以字节为单位的一个SharedArrayBuffer
的长度。
语法
sab.byteLength
描述
byteLength
属性是一个访问者属性,其set访问者函数为 undefined
,这意味着您只能读取此属性。 该值在构造共享数组时建立,并且无法更改。
例子
var sab = new SharedArrayBuffer(1024);
sab.byteLength; // 1024
规范
Specification | Status | Comment |
---|---|---|
ECMAScript (ECMA-262) SharedArrayBuffer.prototype.byteLength |
Living Standard | Initial definition in ES2017. |
浏览器兼容性
BCD tables only load in the browser