getrawmetatable

Reads an object's real metatable.

Syntax

Signature
getrawmetatable(Object: any) -> table?

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
ObjectanyValue whose metatable should be read.

Returns

TypeDescription
table?Actual metatable, or nil.

Notes

Returns nil if Object has no metatable.

Example

Luau
local Object = setmetatable({}, {__metatable = "Locked"})
assert(type(getrawmetatable(Object)) == "table")