Sometimes, we want to convert ArrayBuffer to blob with JavaScript.
In this article, we’ll look at how to convert ArrayBuffer to blob with JavaScript.
How to convert ArrayBuffer to blob with JavaScript?
To convert ArrayBuffer to blob with JavaScript, we use the Blob
constructor.
For instance, we write
const buffer = new ArrayBuffer(32);
const blob = new Blob([buffer]);
to create a Blob
with the buffer
by putting it in an array and using the array as the argument of Blob
.
Conclusion
To convert ArrayBuffer to blob with JavaScript, we use the Blob
constructor.