Проверка JavaScript для неопределенного
if (typeof myVariable === 'undefined'){
//myVariable is undefined
}
Grepper
if (typeof myVariable === 'undefined'){
//myVariable is undefined
}
var x;
if (typeof x === 'undefined') {
// these statements execute
}
if (typeof myVariable === 'undefined'){
//myVariable is undefined
}
let name;
console.log(name); // undefined