Closures
clonefunction
Creates and returns a separate function value for the function passed as the first argument. The argument must be a function.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Creates and returns a separate function value for the function passed as the first argument. The argument must be a function.
clonefunction(func: function): function
local function greet(name)
return "Hello, " .. name
end
local cloned = clonefunction(greet)
print(cloned("Real"))