debug.getconstant
function debug.getconstant(func: (...any) -> (...any) | number, index: number): number | string | boolean | nilParameters
Examples
local function DummyFunction()
local DummyString = "foo bar"
string.split(DummyString, " ")
end
local Result = debug.getconstant(DummyFunction, 2)
print(Result) -- Output: string
-- Optimization Level: 1, Debug Level: 1local function DummyFunction()
local DummyString = "foo bar"
string.split(DummyString, " ")
end
local Result = debug.getconstant(DummyFunction, 3)
print(Result) -- Output: nil
-- Optimization Level: 1, Debug Level: 1Last updated