table.* (array)

Type Library
Revision Release 2022.3683
Keywords table, array

Overview

Tables in Lua implement associative arrays. That is, they can be indexed not just with numbers, but also with strings or any other value of the language, except nil.

When you use tables, you should choose how to index Lua tables (either numerically or non-numerical numbers).

Most functions in the table library assume that the table represents a (numerically-indexed) array or list. For these functions, when we talk about the "length" of a table we mean the result of the length operator.

Functions

table.sort()