SharedArrayBuffer.prototype.byteLength

byteLength 访问器属性表示以字节为单位的一个SharedArrayBuffer的长度。

语法

sab.byteLength

描述

byteLength属性是一个访问者属性,其 set 访问者函数为 undefined,这意味着你只能读取此属性。该值在构造共享数组时建立,并且无法更改。

示例

js

var sab = new SharedArrayBuffer(1024);
sab.byteLength; // 1024

规范

Specification
ECMAScript Language Specification
# sec-get-sharedarraybuffer.prototype.bytelength

浏览器兼容性

BCD tables only load in the browser

相关链接