![js比量undefined种类 js比量undefined种类](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
js比量undefined种类
if (reValue== undefined)
{
alert("undefined");
}
发现推断不出来。最后查了下资料要用typeof方法:
if (typeof(reValue) == "undefined")
{
alert("undefined");
}
typeof 返回的是字符串。有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"
版权声明:本文博主原创文章,博客,未经同意不得转载。