Inequality operator

Comparison with type conversion:

0 != false;           // false

Why is 0 equal to false?

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Challenge: Comparison with the Inequality Operator

Link to the challenge:

The lesson says the following:

Like the equality operator, the inequality operator will convert data types of values while comparing.

The proper lingo is “falsy”. 0 is a falsy value.


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