> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.keys

> Returns the visible keys of a table in a new table marked as a JSON array.

Returns the visible keys of a table in a new table marked as a JSON array.

## Syntax

```lua theme={null}
json.keys(object: table): table
```

## Arguments

| Name     | Type    | Required | Description                                                          |
| -------- | ------- | -------- | -------------------------------------------------------------------- |
| `object` | `table` | Yes      | Table to inspect. The function requires this argument to be a table. |

## Returns

| Name   | Type    | Description                                                                                                                                                          |
| ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `keys` | `table` | New array table containing the source table keys, excluding Real's JSON type marker. The order follows table iteration iteration and is not sorted by this function. |

## Example

Collect the visible keys of a table into a new JSON array table.

```lua theme={null}
local record = {
    name = "Real",
    enabled = true,
    [5] = "numeric key",
}

for _, key in ipairs(json.keys(record)) do
    print(key)
end
```
