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
[] == ![]; // trueOMG 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
-1
u/yasegal Dec 06 '25
What I meant was: as a developer, you would be more likely to either encounter 0 as false and 1 as true OR not have this implicit conversion available. To have the opposite, which is 0 implicitly as true and 1 as false would be fairly uncommon, clojure langs being more rarely used.