首页 > 学院 > 开发设计 > 正文

typeof 运算符

2019-11-18 11:08:11
字体:
来源:转载
供稿:网友

 

返回一个用来表示表达式的数据类型的字符串。

typeof[()eXPRession[]] ;

expression 参数是需要查找类型信息的任意表达式

说明

typeof 运算符把类型信息当作字符串返回。typeof 返回值有六种可能: "number," "string," "boolean," "object," "function," 和 "undefined."

typeof 语法中的圆括号是可选项。

要求

版本 1

请参阅

运算符优先级 运算符总结



发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表