一、typeof
用于判断基本数据类型,但对于null数据类型返回object,[]返回object
故null可以用===符号判断
故
变量===null ?null :typeof 变量
二、instanceof
用于复杂数据类型
eg:变量 instanceof Object
返回true或者false
三、万能工具
Object.prototype.toString.call(a)
返回'[object Array]','[object Object]','[object Number]'等等