Syntax
getconstants(target: function | integer): tableAliases
debug.getconstantsArguments
| Name | Type | Description |
|---|---|---|
target | function | integer | Function, stack level, or prototype to inspect. |
Returns
| Name | Type | Description |
|---|---|---|
constants | table | Array table of constants embedded in the function. |
Description
Returns all constants embedded in a function, stack level, or prototype.
Call it with 1 parameter(s): target. The argument table explains which values are required and which ones only refine the behavior.
It returns constants (table). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = getconstants(1)
print(result)