Variable Scope - Demo 4

This page demonstrates code with 3 different contexts. It produces an error because a nested function that is not available in the global context is executed from the global context.

Additionally, it correctly displays the value of the "player2" variable twice, the first time when it is accessed directly inside the first function. That variable is not directly accessible outside that function.