typeof返回哪些数据类型

来源:互联网 发布:js发表评论及回复代码 编辑:程序博客网 时间:2024/05/03 02:25

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'

0 0
原创粉丝点击