Abstract equality comparison is JavaScript’s double-equals (==) comparison. When operands have different types, JavaScript may coerce one value before comparing them. section 3.3.2
Comparing a number with a string
With hatPrice set to 100 and bootsPrice set to "100", hatPrice == bootsPrice evaluates to true because the string is converted to a number. Use === when the comparison should avoid this coercion. section 3.3.2
Keep comparison coercion separate from arithmetic coercion:
- The + operator converts a number to a string when either operand is a string, producing concatenation such as 100100. section 3.3.2
