/* if (globalVariable) {
But this wouldn't work. That code is actually checking to see if the defined variable globalVariable has a null value. If the variable has not been defined, that code will cause an error.
Instead, here is the code that will check for the presence of a global variable:
*/
if (window.globalVariable) {