The Unclear Impact

Yeah javascript that makes... eh.. sense?

+ true + true + '5' + 3 - 1 === 252

js: true

@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

@sotolf @floppy i had to open node and check this, because i couldn’t believe. blobfoxtableflip this is so wild

replies
0
announces
0
likes
2

@floppy And on the other crazy side you have jsfuck

http://www.jsfuck.com

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)

@sotolf @kristof
a=a=>a+a;a(a('a'-42+'a'))+" Batman"

Re: javascript, sex mention

@kristof @sotolf
Ahahaha, oh dear :D
I heard of this side of bad IoT.
I will enjoy this after today's work, thanks. :)
Running joke: The 'S' in IoT stands for security.

@sotolf This is why I like strongly-typed languages. The above would be flat-out rejected by the compiler as a syntax error in Haskell (or any other sane language).