this post was submitted on 12 May 2024
203 points (95.9% liked)

Programmer Humor

32483 readers
570 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 8 comments
sorted by: hot top controversial new old
[–] tetris11@lemmy.ml 33 points 6 months ago

this is the language we were given on the web, not the language we chose

[–] Tartas1995@discuss.tchncs.de 17 points 6 months ago (3 children)

I can't test it right now but I would love to know. Is it true?

[–] burrito82@feddit.de 39 points 6 months ago* (last edited 6 months ago)

Seems to be so, see Exceptional behavior of document.all

Although document.all is also falsy and loosely equal to undefined, it is not undefined. The case of document.all having type "undefined" is classified in the web standards as a "willful violation" of the original ECMAScript standard for web compatibility.

[–] SpaceNoodle@lemmy.world 18 points 6 months ago (1 children)
[–] lseif@sopuli.xyz 1 points 5 months ago

not strictly

[–] DmMacniel@feddit.de 6 points 6 months ago* (last edited 6 months ago)

typeof x === "undefined" is true.

Then the bastard tries to willingly access x to equate it to undefined, but that can't work since x is undefined and yields a ReferenceError (rendering the third expression moot).

The monks answers of document.all is not applicable since document.all is a live set of data which can be nothing or everything.

Who even introduced document.all? I bet it was microsoft...

[–] sorter_plainview@lemmy.today 6 points 6 months ago* (last edited 6 months ago)

The what?? Is it a condition?

[–] pfm@scribe.disroot.org 6 points 6 months ago

Now I'd love to see a Perl monk comic!