count.js 205 B

12345
  1. import { reduce } from './reduce';
  2. export function count(predicate) {
  3. return reduce((total, value, i) => (!predicate || predicate(value, i) ? total + 1 : total), 0);
  4. }
  5. //# sourceMappingURL=count.js.map