--- -- Returns all elements from all table arguments function unpacks( ... ) local values = {} -- Collect values from all tables for i = 1, select( '#', ... ) do for _, value in ipairs( select( i, ... ) ) do values[ #values + 1] = value end end return unpack( values ) end x = {'a', 'b', 'c', 'd', 'e'} y = {'v', 'w', 'x', 'y', 'z'} print( unpacks( x, y ) )
You need to create an account or log in to post comments to this site.