Standard built-ins
ArrayBuffer
Allocates a zero-initialized fixed-length buffer when no options are supplied.
Formal Syntax & Structure
javascript syntaxjavascript
new ArrayBuffer(byteLength)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| byteLength | number | Requested byte length. |
Return Value
ArrayBuffer
Allocates a zero-initialized fixed-length buffer when no options are supplied.
Working Example
Example Snippetjavascript
(async () => {const b=new ArrayBuffer(4);console.log(b.byteLength,JSON.stringify([...new Uint8Array(b)]));})()