Reputation: 17776
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.
Upvotes: 2
Views: 7578
Reputation: 5546
using instanceof blob you can check.
var MyBlob = new Blob(['content'], {type : 'text/plain'});
console.log(MyBlob instanceof Blob) // true
Upvotes: 5