this post was submitted on 05 Oct 2023
1097 points (96.8% liked)

Programmer Humor

37355 readers
85 users here now

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

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] lanaa@lemmy.ml 10 points 2 years ago (2 children)

Isn't the undefined one incorrect? From what I know undefined means it can contain whatever value. So it could be no toilet paper, full toilet paper or anything in-between.

[–] stebo02@sopuli.xyz 22 points 2 years ago* (last edited 2 years ago) (1 children)

not undefined in mathematics, an undefined variable is just a variable that hasn't been defined (yet) and is therefore nonexistent

[–] ActuallyRuben@actuallyruben.nl 3 points 2 years ago

Depends on what undefinedwe're talking about. JavaScript undefined is just a value for undefined variables. In C undefined behavior could be anything, ranging from reading in random garbage to time travel or summoning eldritch terrors.

[–] JackbyDev@programming.dev 4 points 2 years ago

This is JavaScript undefined specifically where it refers to a key that isn't present.