Is it possible to check if an object is of type Blob in JavaScript?
I'm getting the following error:
TypeError: Argument 1 of FileReader.readAsDataURL does not implement interface Blob.
Is it possible to check if an object is of type Blob in JavaScript?
I'm getting the following error:
Share Improve this question asked May 27, 2017 at 18:14 1.21 gigawatts1.21 gigawatts 17.9k40 gold badges145 silver badges273 bronze badges 2TypeError: Argument 1 of FileReader.readAsDataURL does not implement interface Blob.
- 1 take a look at stackoverflow./questions/20727750/… – Luca Kiebel Commented May 27, 2017 at 18:17
- Thanks. None of the similar search results came up today or I would have seen it was already answered. :) – 1.21 gigawatts Commented May 27, 2017 at 18:30
1 Answer
Reset to default 5using instanceof blob you can check.
var MyBlob = new Blob(['content'], {type : 'text/plain'});
console.log(MyBlob instanceof Blob) // true