Inequality operator problem

Can you explain what is happening here so that the expressions below return false?

1 != true
0 != false

The inequality operator like the equality operator does convert the values so that they have the same types. But in the example above they cannot be converted, right?
So shouldn’t JavaScript returns an error because of it not being able to convert types?

Challenge: Comparison with the Inequality Operator

Link to the challenge:

When comparing with the == and != operators, and when coercing a non-boolean value to a boolean, 0 is considered false, and all non-zero numbers are considered true.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.