Skip to content

Comment on What the fuck javascript

You are viewing one comment and its replies. View all comments

Comments

  • I think this, and the fact that NaN == NaN is false, make perfect sense.
    NaN is the result of mathematically undefined behavior. You’re not going to get a NaN outside of a number context, so tying it together in the Number scope is fine.

    77
    • Same reason NULL != NULL. It makes sense if you understand how these values work.

      3
      • That doesn’t smell right.

        17
        • @LillyPip@lemmy.ca· · edited

          https://richiban.uk/2016/12/21/does-null-equal-null/

          ISNULL may be true, whilst NULL != NULL. NULL is not a value.

          9
          • Ah, my brain was in C mode, where NULL is functionally 0. This is about the concept, which doesn’t apply equally to all languages.

            18
            • @LillyPip@lemmy.ca· · edited

              Yep. There are some languages where this applies, because it’s a mathematical concept. The point is it’s the same ‘no value’ concept, which isn’t shared by implemented the same way by all languages.

              C is strongly typed, and uses pointers, so NULL sort of intrinsically has a value in C.

              edit: my wording was a bit off

              9
        • @djmikeale@feddit.dk· · edited

          You can kinda think of it as null meaning undefined. In this case, “undefined does not equal undefined” seems easier for me to wrap my head around

          5
    • [deleted]·

      [deleted]

    • Collapsed, score -8 is below -5.
    • Collapsed, score -8 is below -5. 15 replies hidden.

Sign in to comment. Sign in