hasmetatable
Checks whether a value carries a metatable.
Reads the raw metatable slot, so a __metatable field does not hide the answer the way getmetatable is hidden from it.
hasmetatable(value: any): booleanParameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to inspect. |
Example
print(hasmetatable(setmetatable({}, {})), hasmetatable({}))Example output
true false