How to create fixed length buffer of bytes in JavaScript

1 Answer

0 votes
let abuffer = new ArrayBuffer(12);

abuffer[0] = 'a';
abuffer[1] = 99;

console.log(abuffer.byteLength);

console.log(abuffer[0]);
console.log(abuffer[1]);



 
/*
 
run:
 
12
a
99
 
*/

 



answered Oct 12, 2020 by avibootz

Related questions

...