| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since July 2015.
The buffer accessor property of DataView instances returns the ArrayBuffer or SharedArrayBuffer referenced by this view at construction time.
// Create an ArrayBuffer
const buffer = new ArrayBuffer(123);
// Create a view
const view = new DataView(buffer);
console.log(view.buffer.byteLength);
// Expected output: 123
The buffer property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when the DataView is constructed and cannot be changed.
const buffer = new ArrayBuffer(8);
const dataview = new DataView(buffer);
dataview.buffer; // ArrayBuffer { byteLength: 8 }
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-get-dataview.prototype.buffer |
This page was last modified on Jul 10, 2025 by MDN contributors.
DataViewObject/FunctionYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |