if (typeof myVar !== "undefined") { console.log("myVar is DEFINED"); }
if(myVar === null) { console.log("Element is undefined"); }
if (typeof myVariable === 'undefined'){ //myVariable is undefined }
if(typeof comment === 'undefined') { alert('Variable "comment" is undefined.'); } else if(comment === null){ alert('Variable "comment" is null.'); }
let id; if(typeof id === 'undefined') { console.log("id is undefined..."); }
let foo = undefined //will return true typeof foo === 'undefined'
if(undefinedElement === null) { console.log("Element is undefined"); }
OAS3