js判断undefined类型
if (reValue== undefined) { alert("undefined"); }
发现判断不出来,最后查了下资料要用typeof方法:
if (typeof(reValue) == "undefined") { alert("undefined"); }
typeof 返回的是字符串,有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"
最后
以上就是帅气往事最近收集整理的关于js用typeof方法判断undefined类型的全部内容,更多相关js用typeof方法判断undefined类型内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复