Introduction to tables

Tables are the only data structure available in Lua. The table data structure is powerful enough to implement other data structures. Tables can also be used to extend the Lua language with a class system, or even a mixin system, which is an alternative to class-based composition. So, what is a table?

Tables are basically a dictionary or array. A table is a key-value pair. If the keys to the table are numeric, the table represents an array. If the keys are non-numeric or mixed, the table is a dictionary. Anything can be used as a key in a table, other than nil. Anything, including nil, can be a value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.82.217