📜  检查类型是否为 blob javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:38.262000             🧑  作者: Mango

代码示例1
You can test if it is an instanceof Blob like this:

var MyBlob = new Blob(['test text'], {type : 'text/plain'});
console.log(MyBlob instanceof Blob) // true
jsFiddle: http://jsfiddle.net/jfriend00/5xkgd/

This will work for things that inherit from Blob also.