r/programminghorror • u/enmaku • Dec 04 '25
This sub in a nutshell
console.log(1 == '1'); // true
console.log(0 == false); // true
console.log(null == undefined); // true
console.log(typeof null); // "object"
console.log(0.1 + 0.2); // 0.30000000000000004
[] == ![]; // true
OMG you guys what weird quirky behavior, truly this must be the single quirkiest language and no other language is as quirky as this!
1.1k
Upvotes
View all comments
Show parent comment
5
u/totallynormalasshole Dec 04 '25
Js isn't even that bad. I swear some people struggle with it and get embittered because they couldn't figure out how to deal with its intricacies. Like bro just make sure your var is a string before you use a string method, not hard. Nothing is stopping you from making your vars soft typed.
var thingStr = "55";
var thingInt = parseInt(thingStr);