javascript check if boolean is undefined

JavaScript
if (typeof myFlag !== "undefined") {
  // comes here whether myFlag is true or false but not defined
}if(undefinedElement === null) {
	console.log("Element is undefined");
}
Source

Also in JavaScript: