Translations:Extension:Scribunto/Lua reference manual/1514/en


 * If 1, nil, or omitted, returns the environment of the function calling $1. Often this will be the same as $2.
 * Integers 2–10 return the environment of functions higher in the call stack. For example, 2 returns the environment for the function that called the current function, 3 returns the environment for the function calling that function, and so on. An error will be raised if the value is higher than the number of function calls in the stack, or if the targeted stack level returned with a tail call.
 * Passing a function returns the environment that will be used when that function is called.