Skip to content

Commit 3dbbc6c

Browse files
committed
Reword paragraph on filter in chapter 5
1 parent 2dc9f2f commit 3dbbc6c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

05_higher_order.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,10 @@ console.log(filter(ancestry, function(person) {
443443
// → [{name: "Philibert Haverbeke", …}, …]
444444
----
445445

446-
This uses the function value (`test`) not just as code to execute, but
447-
as a pluggable way to make a decision. The return value of the function argument
448-
is used to decide whether a given element will be included in the output.
446+
This uses the argument named `test`, a function value, to fill in a
447+
“gap” in the computation. The test function is called for each
448+
element, and its return value determines whether an element is
449+
included in the returned array or not.
449450

450451
Three people in the file were alive and young in 1924: my grandfather,
451452
grandmother, and great-aunt.

0 commit comments

Comments
 (0)