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

Let's briefly talk about the true and false values ​​​​and the equality operator in javaScript

青灯夜游
Release: 2018-10-23 17:22:37
forward
2251 people have browsed it

The content of this article is to briefly talk about the true and false values ​​​​and equality operators in javaScript. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

True and false values

<img src="https://img.php.cn/upload/article/000/000/024/7737e6797de3d835b998ea12579fa470-0.png" alt="">

## Equality operators (== and ===)

Let’s analyze the results of comparing different types of values ​​using the equality operator (==)

toNumber The results returned for different types are as follows:

toPrimitive returns results for different types as follows:

Lets briefly talk about the true and false values ​​​​and the equality operator in javaScript

##=== operator. If the two compared values ​​are of the same type, the result is as follows; if the two compared values ​​are of different types, the returned value is false


The following examples will give you a deeper understanding (exaggeration)

The above is the detailed content of Let's briefly talk about the true and false values ​​​​and the equality operator in javaScript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!