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
1 day ago
130,288 views
0 shares

typescript-memes, javascript-memes, boolean-memes, null-memes, type-safety-memes | ProgrammerHumor.io
More Like This
No comment
1 year ago
230.9K views
0 shares

*Laughs in Typescript*
4 years ago
67.4K views
0 shares

Is There A Better Way To Do This
4 months ago
123.3K views
0 shares

The JavaScript Name Game: Next, Nest, Nuxt, Nervous Breakdown
3 months ago
127.2K views
0 shares

But It's A Design Pattern
2 months ago
140.3K views
0 shares

Is your language eco friendly?
2 years ago
101.1K views
0 shares

Loading more content...