Undefined means a variable has been declared but has not yet been assigned a value. On the other hand, null is an assignment value. It can be assigned to a variable as a representation of no value.Also, undefined and null are two distinct types: undefined is a type itself (undefined) while null is an object.
- Undefined value cannot be explicitly stated that is there is no keyword called undefined whereas null value has keyword called null
- typeof undefined variable or property returns undefined whereas
typeof null value returns object