typeof 12 // 'number'
typeof 'str' // 'string'
typeof undefined // 'undefined'
typeof function add(){} //'function'
typeof [] // 'object' typeof {} //'object'
解释一下 为什么 typeof null 返回 'object'
因为 在计算机中存值都是以二进制存的 typeof 判断的是 前三位 因为null(空指针)它在 计算机中是00000.... 而 引用类型 object 前三位 是 000 所以 typeof null 返回的是 'object'