Infinity
, -Infinity
, NaN
. is reserved as a default initial value for unassigned things.
返回数据类型的字符串表达形式(小写),支持两种语法:函数
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" typeof null // "object", 没法区分 null 与 object 类型 typeof [1,2] // "object", 没法区分 array 与 object 类型 typeof alert // "function",能够区分 function 与 object 类型
专门用来判断对象数据的类型: Object, Array 与 Functioncode
只能判断具备惟一值的类型,即: undefined, null对象
变量自己是没有类型的, 变量的类型其实是变量内存中数据的类型内存