Debug libraryOverview
debug.getconstants
Represents inspection of function constants.
Aliases
getconstantsDetails#
Returns the constant pool of a Luau function or stack level with one-based indices. Function, table and nil entries appear as holes. Compiler optimization changes pool contents and order; use pairs to inspect available entries.
Examples#
Example
local f = assert(loadstring("return 'docs constant'"))
for index, value in pairs(debug.getconstants(f)) do
print(index, value)
end