Test, jeśli jest niezdefiniowany JavaScript
let id;
if(typeof id === 'undefined') {
console.log("id is undefined...");
}
experimental
let id;
if(typeof id === 'undefined') {
console.log("id is undefined...");
}