Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The DataView() constructor creates DataView objects.
Note: DataView() can only be constructed with new. Attempting to call it without new throws a TypeError.
An existing ArrayBuffer or SharedArrayBuffer to use as the storage backing the new DataView object.
byteOffset OptionalThe offset, in bytes, to the first byte in the above buffer for the new view to reference. If unspecified, the buffer view starts with the first byte.
byteLength OptionalThe number of elements in the byte array. If unspecified, the view's length will match the buffer's length.
A new DataView object representing the specified data buffer.
Thrown if the byteOffset or byteLength parameter values result in the view extending past the end of the buffer. In other words, byteOffset + byteLength > buffer.byteLength.
| ECMAScript® 2027 Language Specification # sec-dataview-constructor |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.