Open this example in the interactive library
Source code
const bytes = new Uint8Array([0, 128, 255]);
console.log([...bytes], bytes.byteLength);
Sample output
[ 0, 128, 255 ] 3

Open this example in the interactive library
const bytes = new Uint8Array([0, 128, 255]);
console.log([...bytes], bytes.byteLength);
[ 0, 128, 255 ] 3