Syntax
clonefunction(func: function): functionArguments
| Name | Type | Description |
|---|---|---|
func | function | Function to clone. |
Returns
| Name | Type | Description |
|---|---|---|
clone | function | Cloned function reference. |
Description
Creates a callable clone of a function while preserving its behavior.
Call it with 1 parameter(s): func. The argument table explains which values are required and which ones only refine the behavior.
It returns clone (function). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = clonefunction(function() end)
print(result)