this post was submitted on 21 Apr 2024
702 points (97.1% liked)
Programmer Humor
32410 readers
916 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 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
ah ok , I think I write this a bit more verbose when using other languages, instead of
I do
so checking for numbers being truthy & existing didn't seem like an issue
In the case of a non-existing property, the value would be undefined rather than null.
And while == and != exist in JavaScript, most linters will throw an error and require a === and !== instead as they should be avoided.
Besides, null is a perfectly valid value for a property, just as 0. Working with API Platform, I couldn't tell the number of times I used this kind of statement:
Probably just as much as