typeOf查看字符串类型
typeof undefined
"undefined"
typeof null
"object"
typeof {}
"object"
typeof []
"object"
typeof function(){}
"function"
typeof "aa"
"string"
typeof 11
"number"
typeof true
"boolean
需要注意的:
typeof Infinity === 'number';
typeof NaN === 'number';
typeof (typeof 1) === 'string';
typeof [1, 2, 4] === 'object';
typeof Math.sin === 'function';
typeof Number(1) === 'number';
typeof Symbol() === 'symbol';
typeof Symbol('foo') === 'symbol';
typeof Symbol.iterator === 'symbol';
typeof new Boolean(true) === 'object';
typeof new Number(1) === 'object';
typeof new String("abc") === 'object';
typeof new Function() === 'function';