1、typeof
检测结果:Number、Boolean、String、Function、Object、Undefined
null 和 对象 都会转为Object
2、instanceof
只能检测引用类型的值,variable instanseof constructor,返回布尔值,变量是给定引用类型的实例,返回true,检测基本数据类型,全部返回false。
3、isArray()
Array.isArray(value),检测value是否为数组,无论在哪个全局环境中创建
4、Object.prototype.toString().call()
Object.prototype.toString.call(variable),检测所有的数据类型,返回值为[object Type]