The only reason why we don't use Typescript! Millions of application were build without it, Millions are in products without it, Millions are in development without it and they all just work fine.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"an idiot admires complexity a genius admires simplicity"
- Terry Davis
Yes I can totally agree that many web apps where made without TypeScript because of this!
But it's still kind of amazing to see that TypeScript can literally make something so simple as that add function into something so complicated.
tbh that same code can be rewritten with JS as well type checking both variables and then IF Else of all 3 possible combinations..
The typescript part is verbose on purpose, to make it look silly. In reality you would write it like this:
It's for the memes. But still
I'm pretty sure you might be surprised by this Javascript function...
The only reason why we don't use Typescript! Millions of application were build without it, Millions are in products without it, Millions are in development without it and they all just work fine.