Metatables

isreadonly

Returns whether a table or metatable is currently readonly.

Syntax

isreadonly(target: table): boolean

Arguments

NameTypeDescription
targettableTarget function, table, stack level, or object being inspected or changed.

Returns

NameTypeDescription
readOnlybooleanTrue when the table is readonly.

Description

Returns whether a table or metatable is currently readonly.

Call it with 1 parameter(s): target. The argument table explains which values are required and which ones only refine the behavior.

It returns readOnly (boolean). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = isreadonly({})
print(result)