js check if undefined

JavaScript
if (typeof myVar !== "undefined") {
    console.log("myVar is DEFINED");
}if (typeof myVariable === 'undefined'){
    //myVariable is undefined
}if(myVar === null) {
	console.log("Element is undefined");
}if(typeof comment === 'undefined') {

  alert('Variable "comment" is undefined.');

} else if(comment === null){

  alert('Variable "comment" is null.');

}if (typeof something === "undefined") {
    alert("something is undefined");
}let foo = undefined
//will return true
typeof foo === 'undefined'
Source

Also in JavaScript: