This one is pretty slippy.

The main differences are that:

  • Undefined, as its name suggests, is the value when a variable’s value has not been defined.
  • Null is a value of “no value”.
  • Undefined can have the value of null
  • Null can not have the value of Undefined
  • The == equality operator will return true for a comparison of an undefined variable and null variable
  • The === identity operator will return false for a comparison of an undefined variable and a null variable
  • Undefined is its own type
  • Null is typeof object
Please follow and like us: