javascript中有8中数据类型
- number 数值类型 整型、浮点型,整型的范围在±(2^53-1)
- bigint 任意长度的整数
- string 字符串
- boolean 真、假 true or false
- null 不知道值
- undefined 未赋值
- object 对象 可以存储复杂的数据结构
- symbol 唯一的标识符
typeof用来判断类型,有 typeof x 或者 typeof(x)的用法
typeof undefined // "undefined" typeof 0 // "number" typeof 10n // "bigint" typeof true // "boolean" typeof "foo" // "string" typeof Symbol("id") // "symbol" typeof Math // "object" (1) typeof null // "object" (2) typeof alert // "function" (3)