Uint8Array

A typed array whose elements are single bytes, whole numbers from 0 to 255.

In more detail

It is the standard way to hold binary data in JavaScript, in browsers and Node.js alike. Values outside 0 to 255 wrap around, so 256 is stored as 0.

Example

Node.js Buffer extends Uint8Array; its slice() copies bytes while Buffer's old slice() did not.

Related terms

Taught in

References