Skip to content

Commit b875856

Browse files
committed
Integrate proofreading for Chapter 5
1 parent 92fc601 commit b875856

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

03_functions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ function printFarmInventory(cows, chickens) {
740740
printFarmInventory(7, 11);
741741
----
742742

743-
(((length property,for strings)))(((while loop)))Adding `.length`
743+
(((length property,for string)))(((while loop)))Adding `.length`
744744
after a string value will give us the length of that string. Thus, the
745745
`while` loops keep adding zeros in front of the number strings until
746746
they are at least three characters long.
@@ -1020,7 +1020,7 @@ endif::interactive_target[]
10201020
!!hint!!
10211021

10221022
(((bean counting (exercise))))(((length property,for
1023-
strings)))(((counter variable)))A ((loop)) in your function will have
1023+
string)))(((counter variable)))A ((loop)) in your function will have
10241024
to look at every character in the string by running an index from zero
10251025
to one below its length (`< string.length`). If the character at the
10261026
current position is the same as the one the function is looking for,

04_data.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ JavaScript), it works well.
122122
== Properties ==
123123

124124
(((Math object)))(((Math.max function)))(((length property,for
125-
strings)))(((object,property)))(((period character)))We've seen a few
125+
string)))(((object,property)))(((period character)))We've seen a few
126126
suspicious-looking expressions like `myString.length` (to get the
127127
length of a string) and `Math.max` (the maximum function) in past
128128
examples. These are expressions that access a _((property))_ of some
@@ -166,7 +166,7 @@ know the precise name of the property in advance, because neither “2”
166166
nor “John Doe” is a valid variable name and so cannot be accessed
167167
through dot notation.
168168

169-
(((array)))(((length property,for arrays)))(((array,length
169+
(((array)))(((length property,for array)))(((array,length
170170
of)))The elements in an array are stored in properties. Because the
171171
names of these properties are numbers and we often need to get their
172172
name from a variable, we have to use the bracket syntax to access
@@ -922,7 +922,7 @@ console.log(" okay \n ".trim());
922922
// → okay
923923
----
924924

925-
(((length property,for strings)))(((charAt
925+
(((length property,for string)))(((charAt
926926
method)))(((string,indexing)))We have already seen the string type's
927927
`length` property. Accessing the individual characters in a string can
928928
be done with the `charAt` method but also by simply reading numeric

05_higher_order.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ for (var i = 0; i < array.length; i++) {
134134
----
135135

136136
(((length property,for
137-
arrays)))(((array,indexing)))(((readability)))It's trying to say, “For
137+
array)))(((array,indexing)))(((readability)))It's trying to say, “For
138138
each element in the array, log it to the console”. But it uses a
139139
roundabout way that involves a counter variable `i`, a check against
140140
the array's length, and an extra variable declaration to pick out the
@@ -426,7 +426,7 @@ console.log(JSON.parse(string).born);
426426
----
427427

428428
(((ANCESTRY_FILE data set)))The variable `ANCESTRY_FILE`, available in
429-
the ((sandbox)) for this chapter as well as in
429+
the ((sandbox)) for this chapter and in
430430
http://eloquentjavascript.net/code/ancestry.js[a downloadable file] on
431431
the website(!book (http://eloquentjavascript.net/code#5[_eloquentjavascript.net/code#5_])!), contains the
432432
content of my ((JSON)) file as a string. Let's decode it and see how

0 commit comments

Comments
 (0)