Skip to content

Commit 8f68dd4

Browse files
committed
Small fixes in Chapter 5
1 parent e3270c2 commit 8f68dd4

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
@@ -128,7 +128,7 @@ one by one, blind to the higher-level concepts that they express.
128128
It is a useful skill for, in programming, to notice when you are
129129
working at too low a level of abstraction.
130130

131-
## Abstracting array traversal
131+
## Abstracting repetition
132132

133133
{{index array}}
134134

@@ -186,7 +186,7 @@ want to create a function value on the spot instead.
186186

187187
```
188188
let message = "Wow";
189-
repeat(5, n => {
189+
repeat(5, i => {
190190
message += "!";
191191
});
192192
console.log(message);
@@ -198,7 +198,7 @@ console.log(message);
198198
This is structured a little like a `for` loop—it starts by describing
199199
the kind of loop, and then provides a body. However, the body is now
200200
written as a function value, which is wrapped in the ((parentheses))
201-
of the call to `forEach`. This is why it has to be closed with the
201+
of the call to `repeat`. This is why it has to be closed with the
202202
closing brace _and_ closing parenthesis. In cases like this, where the
203203
body is a single small expression, you could also omit the curly
204204
braces and write the loop on a single line.

0 commit comments

Comments
 (0)