Dec 10, 2017

JavaScript: Null vs. Undefined


  • Undefined is the absence of a definition. It is used as the default value for uninitialized variables, function arguments that were not provided and missing properties of objects. Functions return undefined when nothing has been explicitly returned.
  • Null is the absence of a value. It is an assignment value that can be assigned to a variable as a representation of ‘no-value’.