有关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类型的全部内容,更多相关使用typeof方法判断undefined类型内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复