ts-iterable-functions
    Preparing search index...

    Function maxConst

    • Computes the maximum value from the source iterable using an optional projection and comparer.

      Curried version of _max.

      Type Parameters

      • T

        Element type produced by the source iterable.

      • TOut = T

        Element type produced by the selector and consumed by the comparer.

      Parameters

      • selector: IndexedSelector<T, TOut> = ...

        Selector receiving each element and its index, producing the value to compare.

      • comparer: Comparer<TOut> = defaultComparer

        Comparer determining ordering between projected values.

      Returns (src: Iterable) => TOut | undefined

      The greatest projected value, or undefined when the source is empty.

      Error Rethrows any error thrown by selector or comparer.

      const result = _max([3, 1, 5, 2]);
      console.log(result); // 5

      or using the curried version:

      const result = pipeInto(
      [
      { value: 3 },
      { value: 7 },
      { value: 4 },
      ],
      max((item) => item.value)
      );
      console.log(result); // 7