Kaz Malhotra Posted on Aug 19, 2020 Javascript logic #javascript So, I was messing around with JS and ran into some strange things with it's logic. Here is a screenshot: Doesn't this violate the transitive law of logic? Top comments (2) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand pentacular pentacular pentacular Follow Joined Jul 8, 2020 • Aug 19 '20 Dropdown menu Copy link Hide The == operator is asymmetric due to implicit conversions. Compare with === which does not perform implicit conversions. Collapse Expand Kaz Malhotra Kaz Malhotra Kaz Malhotra Follow I hate compilers because they shred my code to bits Location Null Island Joined Aug 4, 2020 • Aug 21 '20 Dropdown menu Copy link Hide Ok, thanks. I'm used to python's '==' Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
The == operator is asymmetric due to implicit conversions.
Compare with === which does not perform implicit conversions.
Ok, thanks. I'm used to python's '=='