Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil). Junte-se a nós e ajude-nos a fazer o trabalho!
Você também pode ler o artigo em English (US).

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

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
BYTES_PER_ELEMENTChrome Full support 7Edge Full support YesFirefox Full support 4IE Full support 10Opera Full support 11.6Safari Full support 5.1WebView Android Full support 4Chrome Android Full support YesFirefox Android Full support 4Opera Android Full support 12Safari iOS Full support 4.2Samsung Internet Android Full support Yesnodejs Full support Yes

Legend

Full support  
Full support

See also

Etiquetas do documento e colaboradores

Colaboradores desta página: mdnwebdocs-bot, wbamberg, fscholz, jameshkramer
Última atualização por: mdnwebdocs-bot,