debug. getmetatable Synchronous
Read an object’s raw metatable through the debug namespace. It has the same behavior as getrawmetatable, which is convenient when related inspection code already lives under debug.
Luau
debug.getmetatable(value: any) -> Table?Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to inspect. |
Returns
Table?The raw metatable, or nil.
Example
Luau
local object = setmetatable({}, { __index = function() return 0 end })
print(debug.getmetatable(object).__index ~= nil) -- true