Null pointers are considered a billion dollar mistake. Because of all the problems they're causing many programming languages were designed specifically without null values, instead implementing various optional types (i.e. Rust or Haskell). Other languages are trying to fix this (like Optional type in Java). Unfortunatelly, we on the web are stuck with not one null, but with two, each having a different use.
undefined from your code. ES5 is full of function returning
Date objects etc. and wrapping everything with Options ans Results would be
too cumbersome. Still, you can benefit from using these monads in your own functions.