Javascript lets you compare unlike types without extra steps using ==. If you want strict comparison where “2” isn’t 2, use === and !==. Personally, I find that easier than having to parseint or cast every damn thing. That said, I have build tools set up to enforce strict comparison because I don’t trust myself or others.
Comment on Not for me, tho
ElectricTrombone@lemmy.world 1 day agoI’m a C programmer. My first time writing Javascript and ran into some sort of bug involving a === sign or something. Javascript is a silly language.
humorlessrepost@lemmy.world 1 day ago
aesthelete@lemmy.world 1 day ago
Truish and falsish and nullish are all concepts made up by madmen. JavaScript is the language of the damned.
diemartin@sh.itjust.works 1 day ago
FourWaveforms@lemm.ee 1 day ago
The epitomy of irony is a JavaScript developer insisting that some other language is “a fractal of bad design” without immediately acknowledging that JS is weird as hell.
diemartin@sh.itjust.works 15 hours ago
I like Lua’s design. Separate addition (
x+y
) and concatenation (x…y
) operators ftw!FourWaveforms@lemm.ee 11 hours ago
I will have to look into it soon. It has a JIT. I like that.