This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10242|Reply: 2

[JavaScript] JavaScript has three equal signs

[Copy link]
Posted on 2/17/2019 3:55:07 PM | | | |
=== Used to make strict comparative judgments
Example:






Previous:JavaScript decodeURI() function
Next:Node.js classic tutorial to share
Posted on 2/17/2019 7:57:13 PM |


learned

==: The operator is called equality, which is used to detect whether two operands are equal, and the definition of equality here is very loose and allows for type conversion
===: Used to detect whether two operands are strictly equal
1. For basic types such as string and number, there is a difference between == and ===
Comparison between different types, the comparison of =="The value after converting to the same type" to see if the "value" is equal, === If the type is different, the result is unequal
For the same type of comparison, directly compare the "value", and the result of both is the same
2. For advanced types such as Array and Object, there is no difference between == and ===
3. There is a difference between basic types and advanced types, == and ===
For == , convert advanced to base type for a "value" comparison because the type is different === results in false

Posted on 2/18/2019 9:29:03 AM |
learned
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com