Const
Counts the elements of the source iterable that satisfy the optional predicate.
Curried version of _count.
Element type produced by the source iterable.
Predicate receiving each element and its index; truthy results increment the count.
Number of elements accepted by pred, or the total element count when omitted.
pred
Error Rethrows any error thrown by pred.
const evens = _count([1, 2, 3, 4], (value) => value % 2 === 0);console.log(evens); // 2 Copy
const evens = _count([1, 2, 3, 4], (value) => value % 2 === 0);console.log(evens); // 2
or using the curried version:
const evens = pipeInto([1, 2, 3, 4], count((value) => value % 2 === 0));console.log(evens); // 2 Copy
const evens = pipeInto([1, 2, 3, 4], count((value) => value % 2 === 0));console.log(evens); // 2
Counts the elements of the source iterable that satisfy the optional predicate.
Curried version of _count.