DEV Community

Kaz Malhotra
Kaz Malhotra

Posted on

Javascript logic

So, I was messing around with JS and ran into some strange things with it's logic. Here is a screenshot:
JS logic

Doesn't this violate the transitive law of logic?

Top comments (2)

Collapse
 
pentacular profile image
pentacular

The == operator is asymmetric due to implicit conversions.

Compare with === which does not perform implicit conversions.

Collapse
 
cause profile image
Kaz Malhotra

Ok, thanks. I'm used to python's '=='