xxxxxxxxxx
const buffer = new ArrayBuffer(8); // create an 8-byte buffer
const view = new DataView(buffer); // create a data view on the buffer
view.setInt32(0, 42); // set the first 4 bytes to the value 42
const array = Array.from(new Int32Array(buffer)); // convert the buffer to an array
console.log(array); // [42]