typeof 运算符返回一个用来表示表达式的数据类型的字符串。
可能的字符串有:"number"、"string"、"boolean"、"object"、"function" 和 "undefined"。
常用返回值说明
| 表达式 | 返回值 |
| typeof undefined | ‘undefined‘ |
| typeof null | ‘object‘ |
| typeof true | ‘boolean‘ |
| typeof 123 | ‘number‘ |
| typeof "abc" | ‘string‘ |
| typeof function() {} | ‘function‘ |
| typeof {} | ‘object‘ |
| typeof [] | ‘object‘ |
| typeof unknownVariable | ‘undefined‘ |
原文:http://www.cnblogs.com/maqunjing/p/5424279.html