javascript -typeof

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/typeof

Undefined 未定义 Boolean Null Number Function Array
'undifined' 'undifined' "boolean" "object" 'number' 'function' 'object'
Infinity NaN
'number' 'number'
new Function() new String('String') new Number(100) new Boolean(true) class C{}
'function' "object" 'object' 'object' 'function'
typeof /s/
不同浏览器不一样,"object" 或者 'function'

推荐阅读更多精彩内容