is

const is = (obj,type)=>{
    return Object.prototype.toString.call(obj).toLowerCase() ===  `[object ${type.toLowerCase()}]`
}

最后更新于

这有帮助吗?