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

# Nth

# \$nth

The `$nth` operator returns the element at the specified index in an array.

## Input

* An array containing an array value and an integer index

## Output

* The element at the specified index in the array, or null if the index is out of bounds

## Examples

### Get Element at Index

```json theme={null}
{
  "$nth": [
    [1, 2, 3, 4, 5],
    2
  ]
}
```

Result: `3` (element at index 2, 0-indexed)

### From Field

```json theme={null}
{
  "$nth": [
    {
      "$input": "items"
    },
    0
  ]
}
```

Result: The first element of the items field array, or null if the array is empty
