Which comparison operator performs type coercion if the operands are of different types?

  • == (Equality)
  • === (Strict Equality)
  • != (Inequality)
  • !== (Strict Inequality)
The comparison operator == (Equality) performs type coercion if the operands are of different types. This means JavaScript will attempt to convert the operands to the same type before making the comparison. In contrast, === (Strict Equality) checks both value and type without coercion.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *