A table is a type of value that contains other values. Lua's tables are associative, meaning they can be indexed with keys and by number. Special tables called Metatables contain Metamethods that control Lua's operators. Also, unlike most other languages, Lua's number indexes start at 1 not 0.
The following is an sample of indexing using a key.
The following is an sample of indexing using a number.
The following is a sample of a Generic For.
Tables can also contain other tables that can be indexed. These are called multi-dimensional arrays.
The following is an example of multi-dimensional arrays.
Index Syntactic SugarEdit
The following is an example of syntactic sugar for key indexing.