Home > Web Front-end > JS Tutorial > body text

Summary of undefined learning in JavaScript_javascript skills

WBOY
Release: 2016-05-16 17:11:24
Original
944 people have browsed it

When an undeclared variable is used, or a variable that has been declared but not assigned a value is used, or an object property that does not exist is used, this value is returned.

Although undefined and null are not the same, the == operator treats the two as equal, such as

my.prop == null

If the attribute prop does not exist, or it exists but the value is null, then the value of this expression is true.

When an undefined value is used in a boolean environment, it is converted to false, when it is used in a numeric environment, it is converted to NaN, and when it is used in a string environment, it is converted to "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