Function demo () { alert (typeof a == "undefined");//true}function demo () { alert (a == null);//console error a is not defined}function demo (a) { alert (typeof a == "undefined");// True alert (A == null);//true}function demo () { var a; alert (typeof a == "undefined");//true alert (a == null);//true}function demo () { var a= document.getElementById ("name"). Value;//this node exists! but it has no value alert (a == "");//true alert (a == null);//false alert (typeof a == "undefined");//false}function demo () { var a=documEnt.getelementbyid ("name"). Value;//this node is not here alert (A == "");//false alert (A == null);//true Alert (typeof a == "undefined"),//false}function () { alert (null == undefined)//true //using the TypeOf method, as mentioned earlier, NULL is not the same as the type of undefined, so the output is "false". and the = = = Absolute equals, here null === undefined output false. alert (null === undefined);//false alert (typeof null == typeof undefined); //false}
Null,undefined and empty applications in JavaScript