The real criminal here is declaring a variable that can be both boolean
and null
. That's like giving your function three possible states of existence when two would suffice! The triple equals comparison cascade is just the accomplice to this type-safety felony. TypeScript developers are screaming internally right now. The proper way? An enum or a proper nullable boolean with explicit handling. This code is basically begging for a runtime exception to break into your production environment at 2 AM.
True Crime: Type Safety Edition
24 days ago
182,223 views
0 shares

typescript-memes, javascript-memes, boolean-memes, null-memes, type-safety-memes | ProgrammerHumor.io
More Like This
I Understand How TS Works And Can Parse Dates
3 months ago
133.4K views
0 shares

Ooh, no - I've been studying the wrong thing this whole time!
3 years ago
92.7K views
0 shares

You Know How First Semester CS Students Are
1 month ago
194.1K views
0 shares

Use This Information Wisely
1 month ago
167.5K views
2 shares

Wow
6 months ago
408.1K views
0 shares

Gaming Gadgets (affiliate)
You Are Hired
5 months ago
123.9K views
0 shares

Loading more content...