Home > Web Front-end > JS Tutorial > js中,只有三种情况变量值是fasle

js中,只有三种情况变量值是fasle

WBOY
Release: 2016-06-01 09:55:07
Original
1332 people have browsed it

第一, 0是false,这个大家都知道。

注意:var a="0"; 变量a的值是true;

第二,当一个变量未定义时,是undefined类型,undefined类型是false.

第三,NaN是false.

js中,只有这三种情况是false,其他的全部是true.

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