• Björn Tantau
    link
    fedilink
    01 year ago

    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
      link
      fedilink
      2
      edit-2
      1 year ago

      JS null and undefined shenanigans


      basically:

      1. bigger an lesser comparison types convert null to zero, so is zero bigger than zero? no
      2. == is fucky and to it null only equals undefined and undefined only equals null, so no
      3. is zero bigger than or equal to zero? yeah
    • omnislayer88
      link
      fedilink
      11 year ago

      My only thought here might be >= is usually the same as !< and maybe thats how it is defined in javascript and since < is false than >= == !false == true