手机
当前位置:查字典教程网 >编程开发 >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类型】相关文章:

JavaScript操作Cookie方法实例分析

javaScript中with函数用法实例分析

JS+DIV实现鼠标划过切换层效果的方法

javaScript中push函数用法实例分析

JavaScript中继承用法实例分析

javascript常用的方法分享

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

JQuery中节点遍历方法实例

jQuery实现强制cookie过期方法汇总

在JavaScript中使用NaN值的方法

精品推荐
分类导航