Javascript Float32Array byteLength

Introduction

The Javascript Float32Array byteLength property returns the length in bytes of a typed array.

Float32Array.byteLength

The Javascript Float32Array byteLength property is a read only property.

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

If the Float32Array is not specifying an byteOffset or a length, the length of the referenced ArrayBuffer will be returned.

Using the Javascript Float32Array byteLength property

var buffer = new ArrayBuffer(8);

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



PreviousNext

Related