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

typeof操作符

2019-11-08 00:42:32
字体:
来源:转载
供稿:网友

typeof操作符

返回值 - undefined - boolean - string - number - object - function

console.log(typeof null);//object/*应该尽量在声明变量后进行初始化。*/var msg1;//var msg2;console.log(msg1);//undefinedconsole.log(msg2);//报错console.log(typeof msg1);//undefinedconsole.log(typeof msg2);//undefined
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表