var num = 1;  

var str = '1';

var test = 1; 

test == num  //true Same type same type

test === num //true The same type and the same valuetest ! == num//false test has the same type and value as num

num == str  //true converts STR to a number to check if it is equal.num ! = str//false == non-operation

num === str // False returns false depending on the typenum ! == str// True num and STR are of different types, meaning they are not equal= = and! = Comparison If the types are different, try the conversion type first, then perform a value comparison, and finally return the value comparison result. = = = and! == Only values of the same type are compared. (when the value and type are the same) ==, when the two values are of different types, type conversion should be performed before comparison. ===, do not do type conversion, different types must vary.Copy the code