1, for String,number and other basic types, = = and = = = There is a difference
A) comparison between the different types, = = Comparison of "converted to the same type of value" see "Value" is equal, = = = If the type is different, the result is unequal
b) Comparison of the same type, direct "value" comparison, the results of the same
such as alert (' 1 ' ==1);//result is true
Alert (' 1 ' ===1);//result is False
2, for Array,object and other advanced types, = = and = = = There is no difference between
Make a "pointer address" comparison
3, the basic type and the advanced type, = = and = = = There is a difference
a) for = =, advanced conversion to the underlying type for "value" comparison
b) = = = = False due to different types
Such as
var a = new string (' 1 ');//defines a high-level type of string
var b = ' 1 ';//set an underlying type string
alert (b==a);//True
alert (b===a);//Is False
What is the difference between a three equals sign and two equals sign in JavaScript?