JavaScript the correct way to determine the undefined type


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

Found that the judgment can not be made, finally checked the data to use typeof Methods:

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

typeof returns a string with six possibilities: “number”, “string”, “boolean”, “object”, “function”, “undefined”