For use with sorting functions such as sortWith or the built-in Array.prototype.sort(). Sorts in descending 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.numericDesc);sortNumbers([30, 6, 1, NaN, 200, 5]); // [200, 30, 6, 5, 1, NaN]
For use with sorting functions such as sortWith or the built-in
Array.prototype.sort()
. Sorts in descending numerical order, withNaN
last.Example