and has always been using the equal sign "= =" has not been used in JS all equal to the symbol "= =". While these two operators only detect the equality of two objects, one performs a type conversion and one type does not convert, all equals the symbol returns true only before the type is not converted
Copy Code code as follows:
var snum= "66";
var inum=66;
alert (snum==inum);//Output is true
alert (snum===inum);//output is False
The first equals operator converts the value of Snum "66" to a numeric type at the time of comparison, and then returns True when compared to Inum.
The second full equals comparison has no type conversions, so the string and numeric type comparisons cannot be true, and all returns false
There is also a non-full equal sign and a non equal
Copy Code code as follows:
var snum= "66";
var inum=66;
alert (snum!=inum);//Return to False
alert (snum!===inum);//Returns True
The first operator is well understood, the operator converts snum to a numeric type, and the two values are equal to the numeric type and return to False
The second operator does not convert the Snum type so that snum is not equal to Inum, so returns to True
This is also a study of my notes hehe.