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

# getreg

Returns the Lua registry table.

```luau theme={null}
getreg(): table
```

## Returns

`table` - The Lua registry table.

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  local reg = getreg()
  print("Registry elements: ", #reg)
  ```

  ```luau Example 2 theme={null}
  local reg = getreg()
  print(reg[1])
  ```
</CodeGroup>

<Tip>
  This function is an alias of `debug.getregistry`.
</Tip>
