# Quick select

### quickSelect()

```typescript
/**
 * Selects the nth smallest item in unsorted array. Throws an error if array is empty or
 * n value is out of the array bounds.
 *
 * @param arr Array to select from.
 * @param n Sequential number.
 * @param compare Comparison function. Items are compared as numbers by default.
 * @returns Selected item.
 */
export function quickSelect<T>(arr: T[], n: number = 0, compare: CompareFunc<T> = compareAsNumbers): T;
```

Selects the nth smallest item in unsorted array. Throws an error if array is empty or n value is out of the array bounds.
