function getType(obj){
let type = typeof obj;
if (type ! == "object") { // 先进行typeof判断,如果是基础数据类型,直接返回
return type;
}
// 如果typeof返回结果是object, 再进行如下判断,正则返回结果
return Object.prototype.tostring.call(obj).replace(/A[object (IS+)1]$/, '$1');
}
function getType(obj){
let type = typeof obj;
if (type ! == "object") { // 先进行typeof判断,如果是基础数据类型,直接返回
return type;
}
// 如果typeof返回结果是object, 再进行如下判断,正则返回结果
return Object.prototype.tostring.call(obj).replace(/A[object (IS+)1]$/, '$1');
}