Javascript Uint8ClampedArray byteOffset

Introduction

The Javascript Uint8ClampedArray byteOffset property returns the offset in bytes of a typed array from the start of its ArrayBuffer.

Uint8ClampedArray.byteOffset

The Javascript Uint8ClampedArray byteOffset property is a read only property.

The value is set when a Uint8ClampedArray is created and cannot be changed.

Using the Javascript Uint8ClampedArray byteOffset property

var buffer = new ArrayBuffer(8);

var uint8 = new Uint8ClampedArray(buffer);
console.log(uint8.byteOffset); // 0 (no offset specified)

var uint8 = new Uint8ClampedArray(buffer, 3);
console.log(uint8.byteOffset); // 3 (as specified when constructing Uint8ClampedArray)



PreviousNext

Related