First let’s take a look at null.
- Null value needs to explicitly assigned to a variable in order to indicate it stores nothing.null is used to initialize a variable.
- null is of type object.
On the other hand, undefined is
- Value of a variable which is not initialized e.g.
- Value of a property which is not present in an object e.g.
- A function argument which is not being passed e.g.
- The type of an undefined variable is not object.it is undefined. e.g.