数据类型
数据类型的分类
(1)值数据类型
String Boolean Number Undefined Null
(2)引用数据类型
Array Function Object Data
数据类型检测
typeof
只能检测基本数据类型
instanceof
找的不单单是父级,还可能是父级的父级
constructor直接找的是父级,瓶颈就是undefined null
Object.prototype.toString.call() 无敌
(1)值数据类型
String Boolean Number Undefined Null
(2)引用数据类型
Array Function Object Data
typeof
只能检测基本数据类型
instanceof
找的不单单是父级,还可能是父级的父级
constructor直接找的是父级,瓶颈就是undefined null
Object.prototype.toString.call() 无敌