@szilanor/stream
    Preparing search index...

    Variable findLastConst

    findLast: <T>(
        predicate?: PredicateFunction<T>,
    ) => CollectorFunction<T, undefined | T> = last

    Type declaration

      • <T>(predicate?: PredicateFunction<T>): CollectorFunction<T, undefined | T>
      • Returns the last element in the source that satisfies the predicate.

        Type Parameters

        • T

          Type of items in the source.

        Parameters

        • predicate: PredicateFunction<T> = ...

          Predicate function to determine if an element should be returned.

        Returns CollectorFunction<T, undefined | T>

        Collector that returns the last element in the source that satisfies the predicate.

        const result = last<number>((x) => x > 1)([1, 2, 3]);
        console.log(result); // 3