For use with sorting functions such as sortWith or the built-in Array.prototype.sort(). Sorts in ascending numerical order, with NaN last.
Array.prototype.sort()
NaN
import * as A from "flurp/array";import * as C from "flurp/comparator";const sortNumbers = A.sortWith(C.numericAsc);sortNumbers([30, 6, 1, NaN, 200, 5]); // [1, 5, 6, 30, 200, NaN]
For use with sorting functions such as sortWith or the built-in
Array.prototype.sort()
. Sorts in ascending numerical order, withNaN
last.Example