admin管理员组

文章数量:1389187

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:

TypeError: Argument 1 of FileReader.readAsDataURL does not implement interface Blob.

Share Improve this question asked May 27, 2017 at 18:14 1.21 gigawatts1.21 gigawatts 17.9k40 gold badges145 silver badges273 bronze badges 2
  • 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
Add a ment  | 

1 Answer 1

Reset to default 5

using instanceof blob you can check.

var MyBlob = new Blob(['content'], {type : 'text/plain'});
console.log(MyBlob instanceof Blob) // true

本文标签: javascriptHow to check if an object is of type BlobStack Overflow