Kindly read my below post for understanding undefined.
Null is like N/A(not applicable). It’s a non-value, nothing. Both undefined and null indicates absence of value. After declaring a variable but not defined, variable is undefined. But, suppose you want that variable to be non-value, then use null.
var temp=null; console.log(temp);
It will print null.