js判断undefined类型

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

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

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

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

相关文章:

  • 2022-12-23
  • 2021-07-11
  • 2021-08-24
  • 2021-10-02
  • 2022-12-23
  • 2021-08-16
  • 2022-01-16
  • 2022-02-11
猜你喜欢
  • 2022-01-24
相关资源
相似解决方案