Before you look at the next piece of code remember that defining a variable without the
var prefix makes that variable a global variable.
What do you think would be the alert value first time? I thought it would be
Angelina but the correct answer is
undefined. That is because it does not matter where the variable is defined. As long as the variable is defined anywhere within a function then that variable will be set to
undefined. It is when the statement is executed then the value of the variable changes from