1016
The birth of JS (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] devious@lemmy.world 40 points 1 year ago

This is one of the most educational and entertaining reads on the internet, if you are into that kind of thing:

https://github.com/denysdovhan/wtfjs

[-] rikudou@lemmings.world 32 points 1 year ago

Has anyone actually read through that? Reading the first few examples and it's just not understanding how languages work half of the time:

!!"false" == !!"true"; // -> true
!!"false" === !!"true"; // -> true

Wow, no shit, non-empty string coerces to true, who would've guessed! Did you know that !!"bullshit" === !!"true" as well? Mind=blown.

NaN === NaN; // -> false

Again, no shit, that's in the NaN specification and the page even mentions it, so why even include it?

[-] icesentry@programming.dev 1 points 1 year ago

Also, a huge proportion of the list is just not understanding IEEE floats behaviour and blaming the language for it. Exactly like this post is doing. All those weird number things js does is because it only uses floats for everything and every language that uses floats will behave the exact same way.

load more comments (12 replies)
load more comments (13 replies)
this post was submitted on 07 Sep 2023
1016 points (98.9% liked)

Programmer Humor

19187 readers
1122 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS