Module:table/τεκμηρίωση
This is the documentation page for Module:table
Lua metamodules » Module:table = wikt:en:Module:table, 2022.01.02 « Module:fun/τεκμηρίωση = wikt:en:Module:table/documentation
This module provides functions for dealing with Lua tables. All of them, except for two helper functions, take a table as their first argument.
Some functions are available as methods in the arrays created by en:Module:array.
Functions by what they do:
- Create a new table:
shallowClone, shallowcopy, deepcopy, removeDuplicates, numKeys, affixNums, numData, compressSparseArray, keysToList, reverse, invert, listToSet
- Create an array:
removeDuplicates, numKeys, affixNums, compressSparseArray, keysToList, reverse
- Return information about the table:
size, length, contains, keyFor, isArray, deepEquals, deepEqualsList
- Treat the table as an array (that is, operate on the values in the array portion of the table: values indexed by consecutive integers starting at lua:
removeDuplicates, length, contains, serialCommaJoin, reverseIpairs, reverse, invert, listToSet, isArray, deepEqualsList
- Treat a table as a sparse array (that is, operate on values indexed by non-consecutive integers):
numKeys, maxIndex, compressSparseArray, sparseConcat, sparseIpairs
- Generate an iterator:
sparseIpairs, sortedPairs, reverseIpairs
- Other:
sparseConcat, serialCommaJoin, reverseConcat
The original version was a copy of Module:TableTools on Wikipedia via Module:TableTools on Commons, but new functions have been added since then.