https://tutorial.eyehunts.com/js/javascript-checks-if-the-variable-is-defined-example-code/
JavaScript checks if the variable is defined | Example code