Standard built-ins
Uint8Array
Creates byte elements converted to unsigned eight-bit integers.
Formal Syntax & Structure
javascript syntaxjavascript
new Uint8Array(iterable)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| iterable | Iterable<number> | Initial numeric elements; other constructor overloads exist. |
Return Value
Uint8Array
Creates byte elements converted to unsigned eight-bit integers.
Working Example
Example Snippetjavascript
(async () => {const a=new Uint8Array([-1,256,260]);console.log(JSON.stringify([...a]));})()