There are two levels of variable scope in luaEdit
The lua programming language offers two levels of variable scope:
- global - Global variables exist always and are visible everywhere from within the program.
- local - Local variables exist only within the block in which they are created
Variables are global by defaultEdit
In lua, variables are global by default, unless they are declared as local.
Local variables have lexical scopeEdit
In lua, local variables have lexical scope and are visible to functions defined inside the variable scope.
The outer scope (other than the global scope) of a nested function may not be accessed.