Baseless/helpers/MergeTables.lua

14 lines
287 B
Lua
Raw Normal View History

2020-04-22 04:35:40 +00:00
-- Combine multiple tables into one
--
-- *Tables should not share keys
-- *Values are not deep copies
function MergeTables(...)
local newTable = {}
for _, table in pairs({...}) do
for key, value in pairs(table) do
newTable[key] = value
end
end
return newTable
end