countWhere method

int countWhere(
  1. TestPredicate<E> test
)

Returns count of elements that satisfy the predicate test.

Implementation

int countWhere(TestPredicate<E> test) =>
    fold(0, (count, e) => test(e) ? count + 1 : count);