Home  >  Article  >  Web Front-end  >  js-undefined type judgment

js-undefined type judgment

不言
不言Original
2018-04-10 13:29:342286browse

The content shared with you in this article is about js-undefined type judgment. Friends in need can refer to it


js judges undefined type



  if (reValue== undefined){
    alert("undefined");
    }
I found that I couldn’t tell, so I finally checked the information and needed to use typeof
method:
if (typeof(reValue) == "undefined") {
    alert("undefined"); 
    }

typeof Return is a string, there are six possibilities: "number", "string", "boolean", "object", "function", "undefined"

The above is the detailed content of js-undefined type judgment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:js sorting algorithmNext article:js sorting algorithm