makereadonly Synchronous

Mark a table read-only after you finish populating it. This is a quick way to stop accidental later writes to a shared configuration table.

Syntax
Luau
makereadonly(value: Table) -> ()

Parameters

Function parameters
ParameterTypeDescription
valueTableTable to protect from writes.

Returns

()

No value.

Example

Example
Luau
local settings = { theme = "dark" }
makereadonly(settings)
print(isreadonly(settings)) -- true
Kawaii documentation