The TypedArray.BYTES_PER_ELEMENT
property represents the size in bytes of each element in an typed array.
Property attributes of TypedArray.BYTES_PER_ELEMENT |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Syntax
TypedArray.BYTES_PER_ELEMENT;
Description
TypedArray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted. The BYTES_PER_ELEMENT
constant contains the number of bytes each element in the given TypedArray has.
Examples
Int8Array.BYTES_PER_ELEMENT; // 1 Uint8Array.BYTES_PER_ELEMENT; // 1 Uint8ClampedArray.BYTES_PER_ELEMENT; // 1 Int16Array.BYTES_PER_ELEMENT; // 2 Uint16Array.BYTES_PER_ELEMENT; // 2 Int32Array.BYTES_PER_ELEMENT; // 4 Uint32Array.BYTES_PER_ELEMENT; // 4 Float32Array.BYTES_PER_ELEMENT; // 4 Float64Array.BYTES_PER_ELEMENT; // 8
Specifications
Specification | Status | Comment |
---|---|---|
Typed Array Specification | Obsolete | Superseded by ECMAScript 6. |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'TypedArray.BYTES_PER_ELEMENT' in that specification. |
Standard | Initial definition in an ECMA standard. |
ECMAScript Latest Draft (ECMA-262) The definition of 'TypedArray.BYTES_PER_ELEMENT' in that specification. |
Draft |
Browser compatibility
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 |
See also
Document Tags and Contributors
Tags:
Contributors to this page:
jameshkramer,
fscholz
Last updated by:
jameshkramer,