Lemmy.one
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
OsrsNeedsF2P@lemmy.ml to Programmer Humor@lemmy.ml · vor 3 Jahren

Yup, Javascript can go F@#! itself

lemmy.ml

message-square
20
fedilink
42

Yup, Javascript can go F@#! itself

lemmy.ml

OsrsNeedsF2P@lemmy.ml to Programmer Humor@lemmy.ml · vor 3 Jahren
message-square
20
fedilink
  • Björn Tantau@feddit.de
    link
    fedilink
    arrow-up
    0
    ·
    vor 3 Jahren

    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.

    • mycus@kbin.social
      link
      fedilink
      arrow-up
      0
      ·
      vor 3 Jahren

      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
      • Björn Tantau@feddit.de
        link
        fedilink
        arrow-up
        0
        ·
        vor 3 Jahren

        Ugh, thanks, of course. Stupid brain.

        • mycus@kbin.social
          link
          fedilink
          arrow-up
          0
          ·
          vor 3 Jahren

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

          • Quik2007@kbin.social
            link
            fedilink
            arrow-up
            1
            ·
            vor 3 Jahren

            more likely against humans

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

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.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 22 users / day
  • 332 users / week
  • 1.25K users / month
  • 4.85K users / 6 months
  • 440 local subscribers
  • 42.6K subscribers
  • 2.04K Posts
  • 41.2K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org