Skip to content

Commit 8ee9cda

Browse files
committed
Integrate tech editing for Chapter 5
1 parent c1ad76f commit 8ee9cda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

05_higher_order.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ the most characters.
422422
The higher-order operation that represents this pattern is called
423423
_reduce_ (sometimes also called _fold_). It builds a value by
424424
repeatedly taking a single element from the array and combining it
425-
with the previous value. When summing numbers, you'd start with the
425+
with the current value. When summing numbers, you'd start with the
426426
number zero and, for each element, add that to the sum.
427427

428428
The parameters to `reduce` are, apart from the array, a combining
@@ -704,7 +704,8 @@ console.log(countBy([1, 2, 3, 4, 5], n => n > 2));
704704
```
705705

706706
The `countBy` function expects a collection (anything that we can loop
707-
over with `for`/`of`) and a grouping function. It returns an array of
707+
over with `for`/`of`) and a function that computes a group name for a
708+
given element. It returns an array of
708709
objects, each of which names a group and tells you the amount of
709710
elements that were found in that group.
710711

0 commit comments

Comments
 (0)