@szilanor/stream
    Preparing search index...

    Variable lengthConst

    length: <T>(
        predicateFunction?: PredicateFunction<T>,
    ) => CollectorFunction<T, number> = count

    Type declaration

      • <T>(predicateFunction?: PredicateFunction<T>): CollectorFunction<T, number>
      • Counts the number of elements in the source.

        Type Parameters

        • T

          Type of items in the source.

        Parameters

        • predicateFunction: PredicateFunction<T> = ...

          Predicate function to determine if an element should be counted.

        Returns CollectorFunction<T, number>

        Collector that counts the number of elements in the source.

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