使用typeof方法判断undefined类型
有关js判断undefined类型,使用typeof方法,typeof返回的是字符串,其中就有一个是undefined。
js判断undefined类型
if(reValue==undefined)
{
alert("undefined");
}
发现判断不出来,最后查了下资料要用typeof方法:
if(typeof(reValue)=="undefined")
{
alert("undefined");
}
typeof返回字符串,有六种可能:"number"、"string"、"boolean"、"object"、"function"、"undefined"。
在使用时一定要注意。
热门推荐
10 八一祝福语简短文字
11 送同事出院祝福语简短
12 个性留言简短英文祝福语
13 简短的古风生日祝福语
14 亲戚结婚祝福语简短大全
15 企业老板文案祝福语简短
16 送米的祝福语简短
17 高考前放松祝福语简短
18 女儿高考结束祝福语简短