Javascript BigUint64Array length

Introduction

The Javascript BigUint64Array length property stores the element count of a typed array.

BigUint64Array.length

The length property is a read only property.

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

Using the length property

var buffer = new ArrayBuffer(8);

var uint8 = new BigUint64Array(buffer);
console.log(uint8.length); // 8 (matches the length of the buffer)

var uint8 = new BigUint64Array(buffer, 1, 5);
console.log(uint8.length); // 5 (as specified when constructing the BigUint64Array)

var uint8 = new BigUint64Array(buffer, 2);
console.log(uint8.length); // 6 (due to the offset of the constructed BigUint64Array)



PreviousNext

Related