__metatable lock, and returns the object. Passing nil removes the metatable. The object itself must be something that can carry a metatable.
Parameters
any
required
The value to set the metatable on.
table
The new metatable, or
nil to remove it.Returns
any
The same object, for chaining.
Example
Errors
Related
getrawmetatable: read it first.