Concatenation of tables in Lua
snippet in lua

Concatenation of tables in Lua

user466

function TableConcat(t1,t2)
    for i=1,#t2 do
        t1[#t1+1] = t2[i]  --corrected bug. if t1[#t1+i] is used, indices will be skipped
    end
    return t1
end

Concatenation of tables in Lua

user5729

for _,v in ipairs(t2) do 
    table.insert(t1, v)
end