checking for "undefined" values
if (window.myVariable){/* Do something when the variable is defined */}null == undefined; //true
null === undefined; //falseif(window.myVariable != null){ /* Do something when the variable is defined */ }if (typeof(myVariable) !== typeof undefined){/* Do something when the variable is defined */}Last updated