[This is a mock question]
Sometimes when I code a function I don't know how many arguments are being inputted because the amount of arguments needed for the function are unknown and can be infinite. This causes a lot of problems in my function and forces me to do something like this,
function printStrings(a, b, c, d, e)
local strings = {a, b, c, d, e}
print(table.concat(strings, " "))
end
printStrings("Hello,", "World", "I", "love", "you")
As you can see, that's time consuming and has a limit of 5 arguments. If I wanted to have an infinite number of parameters for my printStrings function, how would I go about doing this?

1 comment
Great post. This is by far my favorite answer because of the depth and specificy of the content. I also like that you used an example that is meaningful and provided extra content. Kudos. (The other answers where good too and gave correct content, +1 to all)