Well, let's circle back and talk a little bit more specifically about global scope. global scope is also known as the window object or outermost scope or top level scope. Basically, global scope is any code that is not in a function. So for example, I've got some code here on the left. And as you can see, I've got a couple of variables at the top. And I've got two functions foo and bar and then at the bottom, the code execute those functions.
So the variables speed and greeting and the functions foo and bar. And the execution of those functions are global code. They are defined in the global scope. And that's because they're not defined in a function. So the code that's inside of the Foo and bar function is not global code, because that code is defined inside of a function. So in this case, I've got a variable called app and this app is a private variable.
Because it's defined inside of a function. So it's really important to remember that global scope is any code that is not defined in a function.