Skip to content

Commit b04db57

Browse files
committed
Light pass over chapter 5
1 parent 3073f58 commit b04db57

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

05_higher_order.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ The `ranges` property contains an array of Unicode character ((range))s, each of
240240

241241
{{index [array, methods], [array, filtering], "filter method", [function, "higher-order"], "predicate function"}}
242242

243-
To find the scripts in the data set that are still in use, the following function might be helpful. It filters out the elements in an array that don't pass a test.
243+
If we want to find the scripts in the data set that are still in use, the following function might be helpful. It filters out elements in an array that don't pass a test.
244244

245245
```
246246
function filter(array, test) {
@@ -422,7 +422,7 @@ In terms of what the computer is actually doing, these two approaches are also q
422422

423423
{{index "SCRIPTS data set"}}
424424

425-
One use of the data set would be figuring out what script a piece of text is using. Let's go through a program that does this.
425+
One interesting use of this data set would be figuring out what script a piece of text is using. Let's go through a program that does this.
426426

427427
Remember that each script has an array of character code ranges associated with it. So given a character code, we could use a function like this to find the corresponding script (if any):
428428

@@ -521,7 +521,7 @@ The `countBy` function expects a collection (anything that we can loop over with
521521

522522
{{index "find method"}}
523523

524-
It uses another array method—`find`. This method goes over the elements in the array and returns the first one for which is somewhat like `indexOf`, but instead of looking for a specific value, it finds the first value for which the given function returns true. It returns `undefined` when no such element is found.
524+
It uses another array method—`find`. This method goes over the elements in the array and returns the first one for which a function returns true. It returns `undefined` when no such element is found.
525525

526526
{{index "textScripts function", "Chinese characters"}}
527527

0 commit comments

Comments
 (0)