Both java, c ++, and php have equal operators and equal operators. Of course, except ripts, The = Operator and = operator are used to check whether the two values are equal, they use two different definitions with the same characteristics. Both operators accept any type of operation number. If the two operations are equal, both of them return true; otherwise, both return false, ===, Which is equivalent, it uses a strict definition of the same feature to check whether the two arithmetic operations are identical. = The operator is an equal operator. It uses a loose definition of the same feature to compare whether two arithmetic operations are equal.
This concept has a basic understanding.
Let's take a look at the situation where two values are equal.
=== Comparison of two operators
1. If the two values have different types, they are different.
2. If two values are of the same type as numbers, they are not equivalent unless one or both of them are (NaN ).
3. If the two values are strings and the characters at the same position in the strings are identical, they are completely equivalent. If the length or content of the strings are different, they are not equivalent.
= Comparison of two operators
1. If the two values are of the same type, their equivalence will be detected. If the two values are identical, they are equal. If they are not exactly the same, they are not equal.
2. If the two values have different types, they may still be equal (for example)
1) if one value is null and the other value is undefined, they are equal
2) if a value is a number and another value is a string, convert the string to a number and compare it with the converted value.
3) if a value is true, convert it to 1 and then compare it. If a value is false, convert it to 0 and then compare it.
4) if a value is an object and another value is a number or string, convert the object to the original type value and then compare it.