js判断undefined类型

http://www.cnblogs.com/binaryworms/archive/2010/04/08/1707064.html

 

if (reValue== undefined){
       alert("undefined");
}

 

   发现判断不出来,最后查了下资料要用typeof

if (typeof(reValue) == "undefined") {
   alert("undefined");
}   

 

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

posted @ 2015-07-22 13:01  开拓丿飞  阅读(163)  评论(0编辑  收藏  举报