Lua: Datatypes
From Mario Fan Games Galaxy Wiki
Lua |
---|
Basics |
Intermediate |
Advanced |
|
XLua |
Add to this template |
Lua has 8 basic datatypes as of version 5.1: numbers, strings, booleans, tables, functions, threads, userdata, and nil. Like some other scripting languages, Lua is dynamically-typed, meaning only the values have a type, not a variable; therefore, a single variable can have any type assigned to it no matter what type it currently holds.
Because a specific type matters in some situations, the type() function can be used on any variable or data; this function will return a string containing one of "number", "string", "boolean", "table", "function", "thread", "userdata", or "nil" with respect to that datatype.
Further information about specific types can be found on these pages: