TypedArray.prototype.byteOffset
byteOffset
접근자(accessor) 속성(property)은 그 ArrayBuffer
의 시작점에서 형식화 배열의 오프셋(단위 바이트)을 나타냅니다.
구문
js
typedarray.byteOffset;
설명
byteOffset
속성은 set 접근자 함수가 undefined
인 접근자 속성입니다, 이 속성을 읽을 수만 있음을 뜻하는. 그 값은 TypedArray가 만들어질 때 수립되어 변경될 수 없습니다. TypedArray는 TypedArray 객체 유형 중 하나입니다.
예
byteOffset
속성 사용
js
var buffer = new ArrayBuffer(8);
var uint8 = new Uint8Array(buffer);
uint8.byteOffset; // 0 (지정된 오프셋이 없음)
var uint8 = new Uint8Array(buffer, 3);
uint8.byteOffset; // 3 (Uint8Array를 만들 때 지정된 대로)
명세
Specification |
---|
ECMAScript Language Specification # sec-get-%typedarray%.prototype.byteoffset |
브라우저 호환성
BCD tables only load in the browser