Web APIs
Blob.arrayBuffer()
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);})()