Element type produced by the source iterable.
Key type produced by the selector.
An OrderedIterable representing the descending order and supporting chained thenByDescending calls.
const scores = [12, 27, 18, 27];
const sorted = [..._orderByDescending(scores, (value) => value)];
console.log(sorted); // [27, 27, 18, 12]
or using the curried version:
const sorted = [
...pipeInto(
[12, 27, 18, 27],
orderByDescending((value) => value)
),
];
console.log(sorted); // [27, 27, 18, 12]
Sorts the source iterable in descending order based on a key selector.