Javascript Uint32Array set()

Introduction

The Javascript Uint32Array set() method stores values in the typed array.

Uint32Array.set(array[, offset])
Uint32Array.set(Uint32Array[, offset])
Parameter Optional Meaning
arrayRequired The array from which to copy values.
Uint32Array Required If the source array to copy
offset Optional The offset into the target array to begin writing values. If you omit this value, 0 is assumed.

Using set()

var buffer = new ArrayBuffer(8);
var uint8 = new Uint32Array(buffer);

uint8.set([1, 2, 3], 3);

console.log(uint8); // Uint32Array [ 0, 0, 0, 1, 2, 3, 0, 0 ]



PreviousNext

Related