Infinity arguments in function?

Hello,
In Python, you can create infinite number of arguments when defining a function. Here is an example:

def functioñ(*arguments)
    for argument in arguments:
        print(argument)

functioñ("Jailbreak", "Adopt Me", "Bee Swarm Simulator", 1, 2, 3, 4, 5)

Can I do the same in Lua?

local function test(...)
    local arguments = {...}
    for _, argument in ipairs(arguments) do
        print(argument)
    end
end

... is basically the equivalent in Lua, ... would be a tuple of arguments, not a table, you need to make it a table by encasing it in cruly brackets as I have done

4 Likes