this post was submitted on 25 Jan 2025
1466 points (99.1% liked)

Programmer Humor

20188 readers
1617 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] marcos@lemmy.world 6 points 4 days ago

== has essentially no use unless you remember some completely arbitrary rules

If you make sure the types match, like by explicitly converting things on the same line on that example, then you can use it just like if it was ===.

In fact, there are people that defend that if your code behaves differently when you switch those two operators, your code is wrong. (Personally, I defend that JS it a pile of dogshit, and you should avoid going to dig there.)