json.keys Synchronous

Collect the keys of a table into an array. Use it to build a list of available setting names. Sort the returned array yourself when display order matters.

Syntax
Luau
json.keys(value: Table) -> {any}

Parameters

Function parameters
ParameterTypeDescription
valueTableTable whose keys should be collected.

Returns

{any}

An array containing the table keys. Do not depend on table iteration order.

Example

Example
Luau
local names = json.keys({ theme = "dark", scale = 1 })
table.sort(names)
for _, name in ipairs(names) do
    print(name) -- scale, then theme
end
Kawaii documentation