• JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 year ago

      Basically JavaScript uses undefined to mean keys that don’t exist. You know how sometimes when you’re wondering about the semantics of “present but null” and “absent”? It’s basically that. Undefined means it isn’t there but things are only null if they’ve been set to null.

      There are probably more nuances but that is the gist.

    • deegeese@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      1 year ago

      One is missing but has expected values, the other is completely unknown, like an unimplemented function.

    • ipkpjersi@lemmy.one
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Depends on the programming language. In JavaScript, it literally means that like the key or variable does not actually exist. Whereas like in C/C++, writing random bytes to random memory addresses would result in “undefined behaviour” which means basically anything could happen.