TypedArray.BYTES_PER_ELEMENT
시도해보기
TypedArray.BYTES_PER_ELEMENT
속성은 각 형식화 배열 요소의 크기를 바이트로 나타냅니다.
Property attributes of TypedArray.BYTES_PER_ELEMENT |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
설명
TypedArray 객체는 요소 당 바이트 수 및 바이트가 해석되는 방법으로 서로 다릅니다. BYTES_PER_ELEMENT
상수는 주어진 TypedArray의 각 요소가 갖는 바이트 수를 포함합니다.
예제
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
명세
명세 | 상태 | 설명 |
---|---|---|
Typed Array Specification | Obsolete | ECMAScript 6로 대체됨. |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'TypedArray.BYTES_PER_ELEMENT' in that specification. |
Standard | ECMA 표준에서 초기 정의. |
ECMAScript (ECMA-262) The definition of 'TypedArray.BYTES_PER_ELEMENT' in that specification. |
Living Standard |
브라우저 호환성
BCD tables only load in the browser