But the equal operator == is less strict than the identical operator === and can have some hard to predict results, so it’s typically better to only use the identical operator.

Strings

When comparing a string to an integer the string is evaluated as 0!!

  if ("ABC" == 0)

evaluates true because first “ABC” is converted to integer and becomes 0 then it is compared to 0.

Use === if you are comparing non strings to a string value