===: It is also used to determine whether two values are equal, but there is no implicit conversion process, but a direct judgment, so it is also called absolute equality/congruence.
1. For basic types such as string and number, there is a difference between == and ===
Comparison between different types, == compares "values converted into the same type" to see if the "values" are equal, ===if the types are different, the result will be unequal
Same type comparison, direct "value" comparison, the result will be the same
2. For advanced types such as Array and Object, there is no difference between == and ===
Perform “pointer address” comparison
3. There is a difference between basic types and advanced types, == and ===
For ==, convert the advanced type to the basic type and perform "value" comparison
Because the types are different, the result of === is false
'==': Determine whether the values are the same, not the type
var a = 1,
b = '1';
return a == b; //返回true
'===': accurate judgment, not only the value but also the type
var a = 1,
b = '1';
return a === b; //返回false
1. For basic types such as string and number, there is a difference between == and ===
Comparison between different types, == compares "values converted into the same type" to see if the "values" are equal, ===if the types are different, the result will be unequal
Same type comparison, direct "value" comparison, the result will be the same
2. For advanced types such as Array and Object, there is no difference between == and === for "pointer address" comparison
3. There is a difference between basic types and advanced types, == and ===
For ==, convert the advanced type to the basic type and perform "value" comparison
Because the types are different, the result of === is false
=
: assignment operation==
: Used to determine whether two values are equal, but the determination here is the result of implicit conversion. For example===
: It is also used to determine whether two values are equal, but there is no implicit conversion process, but a direct judgment, so it is also called absolute equality/congruence.Comparison between different types, == compares "values converted into the same type" to see if the "values" are equal, ===if the types are different, the result will be unequal
Same type comparison, direct "value" comparison, the result will be the same
Perform “pointer address” comparison
For ==, convert the advanced type to the basic type and perform "value" comparison
Because the types are different, the result of === is false
'=': means assignment,
'==': Determine whether the values are the same, not the type
'===': accurate judgment, not only the value but also the type
= is the assignment operator
== and === are comparison operators
== will perform implicit data type conversion, === will not, it just compares whether both sides are really equal
http://www.softwhy.com/articl...
"=" is used to assign values, assign values directly.
The "==" operator will convert first and then operate.
"==="Absolutely equal, the values and types on both sides must be equal.
Use as much as possible === ==It’s easy to have problems