Javascript DataView() constructor

Introduction

The Javascript DataView() constructor is used to create DataView objects.

new DataView(buffer [, byteOffset [, byteLength]])
  • buffer - an existing ArrayBuffer or SharedArrayBuffer.
  • byteOffset - Optional, the offset in bytes to the first byte in the above buffer, default to 10.
  • byteLength - Optional, the number of elements in the byte array. default to buffer's length.
var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
console.log(dataview.byteOffset); // 0 (no offset specified)



PreviousNext

Related