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

# numeric-sort-for-extreme

> A numeric sort is used only to read the smallest or largest value.

## What it flags

A numeric comparison sort on a private copy, or a nonmutating numeric sort, is used only to retrieve its first or last value. A single-pass extreme can use constant extra space.

## How to review or fix

The suggested edit requires review. Confirm that every array slot holds a number and that no value is NaN before replacing the sort with a reduction. For example, a hole in the first slot can make the reduction return undefined even when the sorted copy starts with a number.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "numeric-sort-for-extreme": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.