Many people get confused with the difference between undefined and null. In truth, it’s quite simple to see how it works.
=》Undefined is the default value assigned to any variable.
So, if I created a variable as follows and printed its value, it would be undefined.
=》Null has to be assigned by the programmer to empty a variable and is not a default value.
var initialVariable = ‘hello’;
initialVariable = null;
Programming is Easy….