function getType(obj){
let type = typeof obj;
if(type != “object”){
return type;
}
return Object.prototype.toString.call(obj).replace(/^[object (\S+)]$/, ‘$1’);
}
判断数据类型方法函数
最新推荐文章于 2022-03-30 16:02:15 发布
function getType(obj){
let type = typeof obj;
if(type != “object”){
return type;
}
return Object.prototype.toString.call(obj).replace(/^[object (\S+)]$/, ‘$1’);
}