We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

byteLength访问器属性表示一个ArrayBuffer 对象的字节长度。

语法

arraybuffer.byteLength

描述

byteLength属性是一个访问器属性,它的set访问器函数是undefined,这意味着你只能读这个属性。 该值在数组创建时确定,并且不可变更。如果这个ArrayBuffer 被移除,则此属性返回0。

 

示例

var buffer = new ArrayBuffer(8);
buffer.byteLength; // 8

规范

规范 状态 备注
Typed Array Specification Obsolete Superseded by ECMAScript 6.
ECMAScript 2015 (6th Edition, ECMA-262)
ArrayBuffer.prototype.byteLength
Standard Initial definition in an ECMA standard.

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 7.0 4.0 (2) 10 11.6 5.1
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 4.0 (Yes) 4.0 (2) 10 11.6 4.2

相关链接

文档标签和贡献者

此页面的贡献者: kameii, fred4444source
最后编辑者: kameii,