function printabc(a,b,c) print(a,b,c) end local list = {1,2,3} printabc(list)
The above code prints "table:1234567 nil nil"
Is there anyway way, without saying "print(list[1], list[2], list[3])", that the above format will work?
local function printabc(a, b, c) print(a, b, c) end local list = {1, 2, 3} printabc(unpack(list)) -- will unpack the table and print its elements