Function naturalOrder

  • The default comparator which orders values in ascending order.

    naturalOrder generally works well for comparing numbers, strings, Dates, or lists of these values.

    If the values are both iterables (e.g. Array or Map), then they are compared by their elements recursively (see also compareEachWith). Otherwise, values are compared using the < or > operators.

    Parameters

    • a: unknown
    • b: unknown

    Returns number