Web APIs

Blob.arrayBuffer()

Try the free JavaScript compiler

Copy all bytes of a Blob into an ArrayBuffer asynchronously. The original Blob is not consumed. Example console output: [3,4] 2.

Formal Syntax & Structure

javascript syntaxjavascript
blob.arrayBuffer()

Return Value

Promise<ArrayBuffer>

Buffer holding Blob bytes.

Working Example

Example Snippetjavascript
(async () => {const b=new Blob([new Uint8Array([3,4])]); console.log(JSON.stringify(Array.from(new Uint8Array(await b.arrayBuffer()))),b.size);})()
JavaScript Reference