FANDOM


ValuesEdit

EssentialsEdit

There are eight different types of values in Lua. These are boolean, function, nil, number, string, table, thread, and userdata. For specific information on each, please click the links below.

SamplesEdit

Sample
The following demonstrates that foo is of type string.

Source:

local foo = 'bar'
print(type(foo))
Output:

string


ExtraEdit

Once written, Lua doesn't automatically parse values. In order for Lua to parse the value immediately, you must wrap the value in parethesis.

Pitfall
Demonstrates Lua's value parsing behavior.

Wrong:

print({'Hello', 'World'}[1])
Right:

print(({'Hello', 'World'})[1])

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.