Feedback on "getmetatable"

This function never errors on wrong type, and has the behavior of returning nil for other type values. This is extremely useful behavior because it allows you to skip the table check when evaluating if an unknown value is your metatable or not (something that is frequent in tree-like structures).

A note that “This function returns nil on all non-table types” would be very helpful here for pointing that out.

Affected URL: Luau globals | Documentation - Roblox Creator Hub

1 Like

Hi Weeve,

Sorry, I updated the docs based off your feedback a while ago but forgot to reply here. The docs now expand more on the nil behavior for getmetatable.

Thanks for your help in improving the docs! Please feel free to report any other gaps/issues you find.
naahchos