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.
Luau
json.keys(value: Table) -> {any}Parameters
| Parameter | Type | Description |
|---|---|---|
value | Table | Table whose keys should be collected. |
Returns
{any}An array containing the table keys. Do not depend on table iteration order.
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