let myVar; if (myVar === undefined){} //!! Note: myVar == undefined would also check wether myVar is null //alternatively if (typeof myVar === 'undefined'){ }