check if boolean is defined javascript code example
Example: javascript check if boolean is undefined
if (typeof myFlag !== "undefined") {
// comes here whether myFlag is true or false but not defined
}
if (typeof myFlag !== "undefined") {
// comes here whether myFlag is true or false but not defined
}