Member-only story
JavaScript Interview Question: What is a Blob?

If you already enabled a user to download some file from your website, you probably came across the type Blob. You might have checked some example online and adapted them, not thinking twice about what this Blob thing was. As long as it works…
This kind of knowledge can show the difference between a Junior and a Senior developer. Or, as a Junior, would make you stand out as curious and eager to learn. Even if you are not preparing for an interview, having a clear and simple understanding of what a Blob is might help you understand what is going on next time you come across it in a middle of a complex code zipping some PDF files, so here we go:
Usage
To download some simple text you could do something like this:
For more complicated files on the other hand, this won’t be enough. If we want to download a PDF file we generated, we would have to do something like this (this example is using jsPDF):