JavaScript 数据类型转换 及constructor属性
Number()转化为数字
String()转化为字符串
Boolean()转化为布尔值
typeof操作符
type"John" 返回string
typeof NaN 返回number
typeof 3.14 返回number
typeof false 返回boolean
typeof [1,2,3,4] 返回object
typeof {name:"jogn"} 返回object
typeof new Date(); 返回object
type of function(){} 返回function
type of myCar 如果myCar未声明变量则返回undefined
typeof null 返回null