手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >使用typeof方法判断undefined类型
使用typeof方法判断undefined类型
摘要:有关js判断undefined类型,使用typeof方法,typeof返回的是字符串,其中就有一个是undefined。js判断undefi...

有关js判断undefined类型,使用typeof方法,typeof 返回的是字符串,其中就有一个是undefined。

js判断undefined类型

if (reValue== undefined) { alert("undefined"); }

发现判断不出来,最后查了下资料要用typeof方法:

if (typeof(reValue) == "undefined") { alert("undefined"); }

typeof 返回字符串,有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"。

在使用时一定要注意。

【使用typeof方法判断undefined类型】相关文章:

JQuery中clone方法复制节点

javascript常用方法总结

JQuery中Text方法用法实例分析

Jquery使用val方法读写value值

jquery使用each方法遍历json格式数据实例

免费空间广告万能消除代码

JavaScript操作Cookie方法实例分析

在JavaScript中使用NaN值的方法

在JS方法中返回多个值的方法汇总

创建你的第一个AngularJS应用的方法

精品推荐
分类导航