Can someone explain to me why table.unpack() returns the first element of the table only when it is used in a function call with additional parameters after table.unpack() ?
Here is the daemon code:
local a = {1,2,3,4,5} print("Test", table.unpack(a)) -- prints "Test 1 2 3 4 5" print(table.unpack(a), "Test") -- prints "1 Test"
I do not understand why the second line just prints 1 Test . I expect it to print 1 2 3 4 5 Test . Can anyone explain this behavior? I will also be interested in how to make a second call to print 1 2 3 4 5 Test .
lua-table lua
Andreas
source share