# utils/nth

module

<a id="functions">

## Functions

<a id="function-nth">

### `nth( index, iterable ) → T | null`

Returns `nth` (starts from `0` of course) item of the given `iterable`.

If the iterable is a generator, then it consumes **all its items**. If it's a normal iterator, then it consumes **all items up to the given index**. Refer to the [Iterators and Generators](https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Iterators_and_Generators) guide to learn differences between these interfaces.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/nth.ts#L18)

#### Type parameters

* `T`

#### Parameters

* `index: number`
* `iterable: Iterable<T>`

#### Returns

* `T | null`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
