其他分享
首页 > 其他分享> > js判断undefined类型

js判断undefined类型

作者:互联网

看到同事写的前端代码判断undefind:

 

 

 发现判断不出来,最后查了下资料要用typeof
方法:
if (typeof(reValue) == "undefined") {
   alert("undefined");
}  
typeof 返回的是字符串,有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"

https://www.jb51.net/article/48512.htm

标签:www,判断,undefined,htm,number,js,typeof
来源: https://www.cnblogs.com/zhangmo/p/15702182.html