How would you access values inside turples
I was thinking of going like …[1] but that did not work
function a(...)
print(...[1])
end
a("Hello", "john")
How would you access values inside turples
I was thinking of going like …[1] but that did not work
function a(...)
print(...[1])
end
a("Hello", "john")
You can pack them in a table first {…}[1]
local function n(...)
local args = {...}
print(args[1]) -- Hello
print(table.unpack(args)) -- Hello, john
end
n("Hello", "john")