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

青灯夜游
青灯夜游forward
2018-10-23 17:22:372308browse

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!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete