Is there a lua equivalent of javascript’s apply()?

Spread the love

Question Description

In Lua, is there an equivalent of Javascript’s apply() function?

Practice As Follows

Try using () and unpack

function sayhello(name, message)
    print("hello " .. name .. ". " .. message)
end

func1 = sayhello
args1 = {"test", "how are you"}
func1(unpack(args1))

Leave a Comment