arrayBuffer.byteLength
arrayBuffer.byteLength
byteLength访问器属性
表示一个ArrayBuffer
对象的字节长度。
语法
arraybuffer.byteLength
描述
byteLength属性是一个访问器属性,它的set访问器函数是undefined,这意味着你只能读这个属性。 该值在数组创建时确定,并且不可变更。如果这个ArrayBuffer
被移除,则此属性返回0。
示例
var buffer = new ArrayBuffer(8
buffer.byteLength; // 8
规范
Specification | Status | Comment |
---|---|---|
Typed Array Specification | Obsolete | Superseded by ECMAScript 2015. |
ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'ArrayBuffer.prototype.byteLength' in that specification. | Standard | Initial definition in an ECMA standard. |
ECMAScript Latest Draft (ECMA-262)The definition of 'ArrayBuffer.prototype.byteLength' in that specification. | Draft | |
浏览器兼容性
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 7.0 | (Yes) | 4.0 (2) | 10 | 11.6 | 5.1 |
Feature | Android | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | 4.0 | (Yes) | (Yes) | 4.0 (2) | 10 | 11.6 | 4.2 |