Module:UtilsTable/Documentation

Utility library for operating on Lua tables. Inspired by Lodash.

Note that the array functions in this module are not designed to process "sparse arrays" such as  or. The only exceptions are  and , which transform sparse arrays into "dense" ones.

Some functions have two variants: a "normal" variant, and a  variant of the same name but prefixed with. The latter functions are curried and iteratee-first data-last as in lodash/fp. This is useful for composition. For example,

The above example is somewhat contrived for the sake of simplicity. In real contexts, use whichever utility function results in the greatest readability. Sometimes the best option will be to forgo these utilities in favor of plain for-loops.