countWhere method
Returns count of elements that satisfy the predicate test
.
Implementation
int countWhere(TestPredicate<E> test) =>
fold(0, (count, e) => test(e) ? count + 1 : count);
Returns count of elements that satisfy the predicate test
.
int countWhere(TestPredicate<E> test) =>
fold(0, (count, e) => test(e) ? count + 1 : count);