Search code examples
lualua-table

JS-object-like functions for lua tables


Lua tables are similar to JavaScript objects so it seems natural to have functions similar to which js builtin objects Object and Array, and lodash library provide. Namely: keys, values, entries, pick, omit, map, reduce, find, filter, etc Builtin table doesn't have any of this. I know I can code them by myself, but I think somebody had already done this and there should be some libraries on luarocks. Can anybody point them out?


Solution

  • You can check Lua Functional Library, as it implements most (if not all) of the functions you've listed. It targets LuaJIT, but also supports other Lua versions.