Last active
November 14, 2021 22:33
-
-
Save ryanpcmcquen/7aca8ba7f9bce67d3a375fee72094cf3 to your computer and use it in GitHub Desktop.
Kind of like `Object.assign()` for Lua.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function combineTables(...) | |
local combinedTable = {} | |
local arg = {...} | |
for k, v in pairs(arg) do | |
if type(v) == 'table' then | |
for tk, tv in pairs(v) do | |
table.insert(combinedTable, tv) | |
end | |
end | |
end | |
return combinedTable | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This does for tables what
Object.assign
does for objects.