Just trying to wrap my head around Blob
Reading this: https://developer.mozilla.org/en-US/docs/Web/API/Blob gives no explanation as to why the first argument must be an array.
If I do supply multiple things in that array, it just stitches them together end to end which seems like a really odd feature to force on every blob creation
New Blob(["a", "b"])
is the exact same as
New Blob(["a" + "b"])
why??
Not every input can be concatenated by + sign. For example you may want to concatenate 2 blobs:
const blob = new Blob([new Blob(['a']), new Blob(['b'])])
// ab
It's not the same as:
const blob = new Blob([new Blob(['a']) + new Blob(['b'])])
// [object Blob][object Blob]
Using an array as an input it's a bit more flexible as Blob implementation will take care of concatenation of the given input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With