// create an ArrayBuffer with a size in bytes
var buffer = new ArrayBuffer(8);

// use byteLength to check the size
var bytes = buffer.byteLength;

console.log(bytes);
// expected output: 8