DataView.prototype.buffer
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
DataView
인스턴스의 buffer
접근자 속성은 생성 시 이 뷰가 참조한
ArrayBuffer
또는 SharedArrayBuffer
를 반환합니다.
시도해보기
// Create an ArrayBuffer
const buffer = new ArrayBuffer(123);
// Create a view
const view = new DataView(buffer);
console.log(view.buffer.byteLength);
// Expected output: 123
설명
buffer
속성은 설정된 접근자 함수가 undefined
인 접근자 속성으로, 이 속성은 오직 읽을 수만 있습니다.
이 값은 DataView
가 생성될 때 설정되며 변경할 수 없습니다.
예제
buffer 속성 사용하기
js
const buffer = new ArrayBuffer(8);
const dataview = new DataView(buffer);
dataview.buffer; // ArrayBuffer { byteLength: 8 }
명세서
Specification |
---|
ECMAScript® 2025 Language Specification # sec-get-dataview.prototype.buffer |
브라우저 호환성
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buffer |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.