1 When a function executes, identifier resolution searches the scope chain from front to back, starting with the activation object and progressing to the global scope, and if a variable is not found, an error is thrown.
“And what happens is when the function is being executed and it comes across a variable this process of identifier resolution starts. And it starts by looking at the first spot in the scope chain and then makes its way down to the back. So, if it finds it in the first place, awesome, that's what it uses. If it's not found then it goes on to the next place in the scope chain and so on and so forth until either it's found or it's not found and then you end up getting an error.”