Home > Web Front-end > JS Tutorial > Let's briefly talk about the true and false values ​​​​and the equality operator in javaScript

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

青灯夜游
Release: 2018-10-23 17:22:37
forward
2362 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="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/000/024/7737e6797de3d835b998ea12579fa470-0.png" class="lazy" 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:
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
Latest Issues
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template