@szilanor/stream
    Preparing search index...

    Variable findLastOrDefaultAsyncConst

    findLastOrDefaultAsync: <T>(
        defaultValue: ValueOrFactory<T>,
        predicate?: MaybeAsyncPredicateFunction<T>,
    ) => AsyncCollectorFunction<T, T | undefined> = lastOrDefaultAsync

    Type Declaration

      • <T>(
            defaultValue: ValueOrFactory<T>,
            predicate?: MaybeAsyncPredicateFunction<T>,
        ): AsyncCollectorFunction<T, T | undefined>
      • Returns a collector that returns the last entry from the Iterable that satisfies the 'predicate' function or the 'defaultValue'.

        Type Parameters

        • T

          Type of items in the source.

        Parameters

        Returns AsyncCollectorFunction<T, T | undefined>

        Collector that returns the last entry from the Iterable that satisfies the 'predicate' function or the 'defaultValue'.

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