基本类型:number,string,boolean,null,undefined,symbol
引用类型:也称复杂数据类型 Object,function
检测基本数据类型:typeof 变量名
特殊:
typeof null 返回 Object
typeof 函数名 返回function
如何检测是否是一个数组:
1. Array.isArray(数组名)
2. Object.prototype.toString.call(要检测的目标)
function isArray(target) {
return Object.prototype.toString.call(target) ==="[object Array]"
}