There were only simple and short definitions last. This time we will stick to it too.
Variable Environment simply means that Where variables live and how they are interrelated in memory.
We have the script. At the moment all who have read the previous parts should be aware of how and in what order the code is executed. Because of that, we will go straight to variables. Specifically, the variable myVar, which depending on the place of occurrence is 1, 2 or undefined.
If you want to check if this is really true, all we have to do is to run a script. When we do it, altought a variable has the same name everywhere, our result in the console will be:
I will talk about the Scope Chain