@szilanor/stream
    Preparing search index...

    Function minBy

    • Returns the element in the source that has the minimum value according to the comparer.

      Type Parameters

      • T

        Type of items in the source.

      Parameters

      Returns CollectorFunction<T, undefined | T>

      Collector that returns the element in the source that has the minimum value according to the comparer.

      const result = minBy<number>((a, b) => a - b)([1, 2, 3]);
      console.log(result); // 1