Notice that, in a declaration like , the new being declared is not in scope yet, and so the second refers to the outside variable.
A local variable used by an inner function is called an upvalue, or external local variable, inside the inner function.
The loop creates ten closures (that is, ten instances of the anonymous function). Each of these closures uses a different variable, while all of them share the same .