debug.getconstants
Returns every constant baked into a function, string literals, numbers and global names.
Signature
debug.getconstants(fn: function | number): { any }Parameters
fnfunction | numberThe function, or a stack level.
Returns
{ any }
Example
local function login()
return "token-123", 42
end
for index, constant in debug.getconstants(login) do
print(index, constant)
end