the = = operator and the = = operator are used to detect whether two values are equal, and they employ two different definitions of the same trait. Both operators accept operands of any type, and if two operands are equal, they all return true, otherwise the false,=== operator is returned as the equivalent operator, and it uses the strict same trait definition to detect whether the two counts are identical, and the parents ' attention is exactly the same. The = = operator is the equality operator, which uses a relatively loose definition of the same trait to compare the equality of two operands.
There is a basic understanding of this concept.
The following is a specific decision two values are the same situation bar.
= = = Operator Two value comparison
1, if two value types are different, they are not the same
2, if the two-value type is a number and the value is the same, then unless one or two of the middle is a (NaN), they are not equal, otherwise they are equivalent
3, if two values are strings, and the characters are identical in the same position in the string, they are identical, and if the length or content of the string is different, then they are not equal.
= = Operator Two value comparison
1, if the two values are of the same type, then check their equivalence. If two values are exactly the same, they are equal. If they're not exactly the same, they're not equal.
2, if two values are of different types, they may still be equal (for a few examples)
1 if one value is null and the other is undefined, they are equal
2 If a value is a number, another value is a string, converts the string to a number, and then compares it with the converted value
3 If a value is true, it is converted to 1 and then compared. If a value is false, convert it to 0, and then compare it
4 If a value is an object, another value is a number or a string, the object is converted to the original type of value, and then compared.