You are viewing a single thread.
View all comments
1 point

Can someone explain this? I mean, the last result. Usually I can at least understand Javascript’s or PHP’s quirks. But this time I’m stumped.

permalink
report
reply
1 point
*

I would guess null is coerced to a number

permalink
report
parent
reply
0 points

JS null and undefined shenanigans


basically:

  1. bigger an lesser comparison types convert null to zero, so is zero bigger or lesser than zero? no
  2. == is fucky and to it null only equals undefined and undefined only equals null (and themselves), so no
  3. is zero bigger than or equal to zero? yeah
permalink
report
parent
reply
0 points

Ugh, thanks, of course. Stupid brain.

permalink
report
parent
reply
0 points

I’m starting to think JS maintainers have a thing against mathematicians

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 3.3K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments