The DataView view provides a low-level interface for reading and writing multiple number types in an ArrayBuffer irrespective of the platform's endianness.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

Return value

Exceptions

Thrown if the byteOffset and byteLength result in the specified view extending past the end of the buffer.

Description

Endianness

Multi-byte number formats are represented in memory differently depending on machine architecture, see Endianness for an explanation. DataView accessors provide explicit control of how data will be accessed irrespective of the platform architecture's endianness.