- "null == undefined" returns true
- "null === undefined" returns false
- Both null and undefined are falsy
- Both have no properties or methods
Null
- Language keyword
- typeof("null") = "object" -- i.e. null is actually a generic object
- Therefore can be used to represent --
- Absence of a value
- "No object"
- No value for strings and numbers as well as objects
Undefined
- Predefined global constant
- typeof("undefined") = "undefined" -- i.e. undefined is of its own special type
- undefined also represent absense of a value
- But can be specific to following situations
- Variable value uninitialized
- Object property / Array element does not exist
- Function has no return type
- Function argument missing value