js null vs undefine code example
Example 1: js null vs undefine
var TestVar;
alert(TestVar); //shows undefined
alert(typeof TestVar); //shows undefined
Example 2: js null vs undefine
var TestVar = null;
alert(TestVar); //shows null
alert(typeof TestVar); //shows object