if (myVar != undefined){ console.log("Defined") } if (myVar != "undefined"){ console.log("Defined") }