js判断undefined类型

    if (reValue== undefined){
    alert("undefined");
    }
  发现判断不出来,最后查了下资料要用typeof
方法:
if (typeof(reValue) == "undefined") { 
   alert("undefined"); 
}  

typeof 返回的是字符串,有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"

标签: none


阿里云优惠主机

添加新评论

免责声明
本博客部分内容来自于互联网,不代表作者的观点和立场,如若侵犯到您的权益,请联系[email protected]。我们会在24小时内进行删除。