local

In Lua, variables can be global or local. Unlike global variables, local variables have their scope limited to the block where they are declared.

It is good programming style to use local variables whenever possible. Local variables help you avoid cluttering the global environment with unnecessary names. Moreover, the access to local variables is faster than to global ones.

Usage

local foo = "bar"

See Also

Programming in Lua