Why does typeof null return object? How to check if a value is null?

typeof null == 'object' will always return true because this was the implementation of null since the birth of JavaScript. A fix was proposed to change typeof null == 'object' to typeof null == 'null' but was rejected because it will lead to more bugs.

We can use the === or strict equality operator to check if a value is null.

  function isNull(value){
    return value === null;
  }