Add table.concat

This commit is contained in:
Simon Brodtmann 2025-02-19 00:11:13 +01:00
parent 39dca1c3b2
commit f8c4b94165

View file

@ -68,4 +68,19 @@ function table.filter(target, predicate)
end end
end end
return result return result
end
--- Concatenates two tables into a new table.
--- @param table1 table The first table
--- @param table2 table The second table
--- @return table The concatenated table
function table.concat(table1, table2)
local result = {}
for _, v in pairs(table1) do
table.insert(result, v)
end
for _, v in pairs(table2) do
table.insert(result, v)
end
return result
end end