In Lua, is there an equivalent of Javascript's apply() function?
Try using ()
and unpack
function sayhello(name, message)
print("hello " .. name .. ". " .. message)
end
func1 = sayhello
args1 = {"test", "how are you"}
func1(unpack(args1))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With