js 判断数据类型
作者:互联网
function getType(variable)const numArr = [1,2,3]; getType(numArr); //array
return typeof variable === 'object' ? Object.prototype.toString.call(variable).replace('[object ', '').replace(']', '').toLowerCase() : typeof variable; }
标签:判断,getType,数据类型,object,js,typeof,numArr,variable,replace 来源: https://www.cnblogs.com/150536FBB/p/13345371.html