Skip to content

Commit 6f392dd

Browse files
committed
Integrate proofreading for chapter 3
1 parent da6e6d1 commit 6f392dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

03_functions.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ What happens to local variables when the function call that created
461461
them is no longer active?
462462

463463
The following code shows an example of this. It defines a function,
464-
`wrapValue` that creates a local variable. It then returns a function
464+
`wrapValue`, which creates a local variable. It then returns a function
465465
that accesses and returns this local variable.
466466

467467
[source,javascript]
@@ -682,7 +682,7 @@ The indentation suggests the depth of the call stack. The first time
682682
`find` is called it calls itself twice to explore the solutions that start with
683683
`(1 + 5)` and `(1 * 3)`. The first call tries to find a solution that
684684
starts with `(1 + 5)` and, using recursion, explores _every_ solution
685-
that yields a number smaller than or equal to the target number. Since
685+
that yields a number less than or equal to the target number. Since
686686
it doesn't find a solution that hits the target, it returns `null`
687687
back to the first call. There the `||` operator causes the call that
688688
explores `(1 * 3)` to happen. This search has more luck because its
@@ -881,7 +881,7 @@ function, re-created every time the function is called, and not visible
881881
from the outside. Functions declared inside another function have
882882
access to the outer function's local scope.
883883

884-
Separating the different tasks your program performs into different
884+
Separating the tasks your program performs into different
885885
functions is helpful. You won't have to repeat yourself as much, and
886886
functions can make a program more readable by grouping code into
887887
conceptual chunks, in the same way that chapters and sections help
@@ -936,7 +936,7 @@ or odd:
936936

937937
- One is odd.
938938

939-
- For any other number N, its evenness is the same as N - 2.
939+
- For any other number _N_, its evenness is the same as _N_ - 2.
940940

941941
Define a recursive function `isEven` corresponding to this
942942
description. The function should accept a `number` parameter and
@@ -999,7 +999,7 @@ are in the string.
999999

10001000
Next, write a function called `countChar` that behaves like `countBs`,
10011001
except it takes a second argument that indicates the character that is
1002-
to be counted (rather than counting only uppercase "B" characters).
1002+
to be counted (rather than counting only uppercase “B” characters).
10031003
Rewrite `countBs` to make use of this new function.
10041004

10051005
ifdef::interactive_target[]

0 commit comments

Comments
 (0)