For the first around 5 years of my developer life, I never touched JS. I first learned Java and wanted to distance myself from it as far as possible as I assumed they were similar.
Well, they are. They’re both f*king stupid. In the same ways, no, but still stupid. In C, if I wanted to check if something was a valid number, I’d simply use
myvar as int and check for null. If I compare that variable to another, it’ll do a type check. But instead, in JS, I have to do hacky BS like
if (!(myvar <= 0)) to check if something is not only greater than 0, but also not undefined and of the same type. Why can’t I just do
Continue reading →