js比量undefined种类

时间:2023-03-09 19:14:40
js比量undefined种类

js比量undefined种类

if (reValue== undefined)

{

    alert("undefined");

}

发现推断不出来。最后查了下资料要用typeof方法:



if (typeof(reValue) == "undefined") 



   alert("undefined"); 

}

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

版权声明:本文博主原创文章,博客,未经同意不得转载。