this post was submitted on 05 Aug 2025
121 points (98.4% liked)
Programmer Humor
37634 readers
333 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's not. Just tried in my Browser Console:
I genuinely wasn't aware of that. I must be getting javascript confused for almost any other language. I wonder how many times ive !!'d a value to make that work without actually absorbing that into my head now..
2 is not == true, but !!2 is true
In other languages that shouldn't be equal either though, right?
Maybe you meant
Which would output
and that would actually work in all languages I know. But that's different from being equal.
Yeah its checking for not null with if isnt it. Maybe thats what has me confused