It is equal to (==) and congruent (===)

Verbatim https://www.dazhuanlan.com/2019/08/26/5d62f844c813e/


Type conversion will be equal before the operation in the operand, the data type conversion is not congruent. example:


   
   
1
2
  var result1 = ("55" == 55);     //true, 因为转换后相等
  var result2 = ("55" === 55);    //false, 因为两个操作数的数据类型不一样

NOTE: null == will return undefined true, because they are similar values; null === undefined but returns false, because they are different types of values. Since the equality and inequality problem type conversion operator, and in order to maintain the integrity of the data type code recommended congruent and incongruent operators.

Guess you like

Origin www.cnblogs.com/petewell/p/11410428.html