Javascript DataView byteOffset

Introduction

The Javascript DataView byteOffset property represents the offset in bytes of this view.

dataview.byteOffset

Using the byteOffset property

var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
console.log(dataview.byteOffset); // 0 (no offset specified)

var dataview2 = new DataView(buffer, 3);
console.log(dataview2.byteOffset); // 3 (specified when constructing the DataView)



PreviousNext

Related