在线文档教程

sharedArrayBuffer.byteLength

sharedArrayBuffer.byteLength

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

语法

sab.byteLength

描述

byteLength只可以被读取,不可以被赋值。这个变量会在array创建的时候生成,且无法更改

示例

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

规范

SpecificationStatusComment
ECMAScript Latest Draft (ECMA-262)The definition of 'SharedArrayBuffer.prototype.byteLength' in that specification.DraftInitial definition in ES2017.

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic supportNo supportNo support55 (55) 1No supportNo supportNo support

FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic supportNo supportNo support55.0 (55) 1No supportNo supportNo support