您的位置:首页 > 其它

typeof返回哪些数据类型

2016-05-06 00:00 344 查看
typeof 运算符返回一个用来表示表达式的数据类型的字符串。 
可能的字符串有:"number"、"string"、"boolean"、"object"、"function" 和 "undefined"。 

2、常用返回值说明

表达式返回值
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'

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: