• For use with sorting functions such as sortWith or the built-in Array.prototype.sort(). Sorts in ascending numerical order, with NaN last.

    Example

    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]

    Parameters

    • x: number
    • y: number

    Returns 0 | 1 | -1