JS的7种数据类型
number 数字
string 字符串
bool 布尔
symbol 符号
undefined 空
null 空
object 对象
数组、函数、日期 它们都属于object
JS五个假值,其他都是真的
- undefined null 0 NaN ''
类型转换
number => string
String(n),或者n+''
string = > number
Number(s)
parselnt(s) / parseFloat(s)
s-0
x => bool
Boolean(x)
!!x
x => string
String(x)
x.toString()