> ## 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-array-default-sort

> An array of numbers is sorted without a comparator.

## What it flags

Calling `sort()` or `toSorted()` on a numeric array without a comparator orders its numbers as strings. For example, `10` sorts before `2`. The finding appears with `--include-contextual`.

## How to review or fix

Confirm the intended order before choosing a comparator. Consider how to order `NaN` if it can appear. Numeric typed arrays use a numeric default order.


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