1,typeOf 只能判断除null以外的基本数据类型
console.log(typeof(123)) //number
console.log(typeof(true)) //boolean
console.log(typeof('TEST')) //string
console.log(typeof(undefined)); //undefined
console.log(typeof(null)); //object
console.log(typeof([])) //object
console.log(typeof({})) //object
console.log(typeof(new Date())) //object
console.log(typeof(function(){})) //function
console.log(typeof Array) //function
var test=new String('test')
console.log('test')
console.log(test) //[String: 'test']
**##### 注意:1,不能识别null是因为 是用机器码的后3位来表示类型的 null和object 类型的数据的机器码的后3位都是000
2,typeof检测引用型类型时会粉2种情况,有call方法的会返回function,没有call方法的会返回Object**
2,instance of
function Person(){}
console.log([] instanceof Array) //true
console.log({} instanceof Object) //true
console.log(new Date() instanceof Date) //true
console.log(new Person() instanceof Person) //true
注意:检查的是是否是一个类的实例
3,基本数剧类型和引用型数据类型都可以检测
Object.prototype.toString.call('1') //[object String]
Object.prototype.toString.call([]) //[object Array]