@sotolf gave I tried this with the interactive NodeJS-REPL, with live-feedback of evaluation results as I type.
Althought you gave away the punchline, the build-up still made laugh.
Also this kind of breaks my head:
null == 0; // -> false
null > 0; // -> false
null >= 0; // -> true
so null is not 0, it's not bigger than 0, but it is bigger or equal to 0 :|
@floppy It's kind of wild ;) yeah, I was thinking of leaving the answer out, but was thinking that most people, like me are too lazy to actually try it out, so I added it so that it would make sense ;)
@sotolf JavaScript is so wild! :)
Yes, actually knowing that weird expression evaluates to true drew me in to try it myself. (And it's... delicious 👌 that it's even three equal signs and not just two.)
@sotolf Haha, that one's awesome too, indeed!
I couldn't describe my most favourite JavaScript quirk from the top of my head.
But luckily I got bookmarks instead of a functioning wetware memory and somebody posted this a while ago somewhere on the Fediverse:
8 Javascript quiz that may confuse you
https://pitayan.com/posts/8-javascript-quiz-that-may-confuse-you
- replies
- 1
- announces
- 0
- likes
- 2
@floppy And on the other crazy side you have jsfuck
which for some ungodly reason is valid javascript :p
Re: javascript, sex mention
@sotolf @floppy among these implicit conversion shenanigans, this is still my favorite: https://invidious.fdn.fr/hty3ZW3Soag?t=2142 (and the reason why i’m afraid of processing foreign data without typescript and something like zod
or io-ts
)