Aliases
getconstants
Arguments
function | number
required
The function to inspect, or a positive stack level identifying a caller.
Returns
{any}
A 1-based constant table. Nil, function, and table slots are represented as nil and may leave holes.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Returns a Lua prototype’s constants by 1-based slot.
debug.getconstants(target: function | number): {any}
getconstantslocal function sample() return "docs-example" end
for index, value in pairs(debug.getconstants(sample)) do print(index, value) end
