Home > Web Front-end > JS Tutorial > js determines undefined variable type using typeof_javascript technique

js determines undefined variable type using typeof_javascript technique

WBOY
Release: 2016-05-16 17:32:56
Original
1172 people have browsed it

js directly uses

to copy the code The code is as follows:

if(mydata== 'undefined'){
alert("undefined");
}

This is a very low-level error, so:
Copy code The code is as follows:

if(typeof(mydata)=='undefined'){
alert("undefined") ;
}
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template