and ? :
-ternary statements, as well as the test clauses in while
and for
loops, all perform an implicit value comparison. But what sort? Is it “strict” or “coercive”? Both, actually.
You might think of these conditional expressions like this:
Oops. So what is the if
statement actually doing? This is the more accurate mental model:
You just can’t get away from coercions in JS comparisons. Buckle down and learn them.