我是靠谱客的博主 傲娇外套,这篇文章主要介绍使用typeof方法判断undefined类型,现在分享给大家,希望可以做个参考。

有关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类型内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(227)

评论列表共有 0 条评论

立即
投稿
返回
顶部