Comparison between = = and = = = operator in JS

Source: Internet
Author: User

Summary:

= = = Operator:
Returns False if two value types are different
Returns true if all two values are of type number and the values are the same
Returns true if all two values are stirng and the string content of the two value is the same
Returns true if all two values are true or both are false
Returns true if all two values point to the same Object,arraya or function
Returns true if two values are null or both are undefined
= = Operator:
If two values have the same type, the = = = comparison is made, and the comparison value = = = is returned
It is also possible to return true if two values do not have the same type
Returns true if one value is null and another value is undefined
If one value is a string and the other is number, the string is converted to number and then compared
If a value is true, it will be converted to 1 and then the false will be turned to 0.
If a value is object and the other is number or string, the object is converted to the original type using ValueOf () or ToString () and then compared

Comparison between = = and = = = operator in JS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.