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

实现placeholder效果的方案汇总

javascript常用的方法分享

javaScript中with函数用法实例分析

JQuery中clone方法复制节点

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

javaScript中push函数用法实例分析

JavaScript中用toString()方法返回时间为字符串

JQuery中Text方法用法实例分析

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

JavaScript中用getDate()方法返回指定日期的教程

精品推荐
分类导航