if undefined angular

JavaScript
/* Then you can check if the variable z is undefined as:*/
let myvariable : any;
if(myvariable === undefined)
{

}
Source

Also in JavaScript: