Skip to main content
Module

x/lazy/lib/lazy.ts>Lazy#orderBy

A linq-like lazy-evaluation enumerable/iteration library that aims to support deno, node & browser
Latest
method Lazy.prototype.orderBy
import { Lazy } from "https://deno.land/x/lazy@v1.7.3/lib/lazy.ts";

Sorts the iterable in ascending order.

Parameters

keyFn: MapFn<TElement, TKey>

The function used to get the key from a given element.

optional
compareFn: SortFn<TKey>

The function that is passed to Array.prototype.sort to compare values and return the comparison number. If not given, a default sorting function will be used. This sorting function will match the behaviour of the standard sort comparison function.

Returns

Lazy<TElement>