118

That's it. That's the meme.

you are viewing a single comment's thread
view the rest of the comments
[-] Mr_Fish@lemmy.world 18 points 4 days ago
[-] Telemachus93@slrpnk.net 13 points 4 days ago

Mh, '0' is a nonempty string, so !'0' returns false. Then of course !(!'0') would return true. I'd absolutely expect this, Python does the same.

And the second thing is just JavaScript's type coercion shenanigans. In Python

bool('0') # returns True because of nonempty string
bool(int('0')) # returns False because 0 == False

Knowing that JavaScript does a lot of implicit type conversions, stuff like that doesn't strike me as very surprising.

[-] lime@feddit.nu 3 points 4 days ago

wait hang on...

this post was submitted on 05 Aug 2025
118 points (100.0% liked)

Programmer Humor

37656 readers
192 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS