JS中的数据类型
基本数据类型:String、Number、Boolean、Null、Undefined
引用数据类型:Object
typeof
typeof检测变量机器码的后三位,返回number、string、boolean、undefined、object
检测null类型的数据时,返回object,因为null的机器码全是0,后三位自然是0
instanceof
instanceof检测原型链,A instanceof B(A是否是B的实例对象),返回true、false
当instanceof检测到object类型时,会再次检测是否含有call方法,如果有返回function,否则返回object