Skip to content

Commit 70a3a40

Browse files
committed
Integrate proofreading edits for Chapter 1
1 parent 42b82be commit 70a3a40

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

01_values.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ data—but anything that isn't data simply does not exist. All this data
2222
is stored as long sequences of bits and is thus fundamentally alike.
2323

2424
(((CD)))(((signal)))Bits are any kind of two-valued things, usually
25-
described as zeroes and ones. Inside the computer, they take forms
25+
described as zeros and ones. Inside the computer, they take forms
2626
such as a high or low electrical charge, a strong or weak signal, or a
2727
shiny or dull spot on the surface of a CD. Any piece of discrete
2828
information can be reduced to a sequence of zeros and ones and thus
@@ -94,10 +94,10 @@ memory.
9494
number of bits, namely 64 of them, to store a single number value.
9595
There are only so many patterns you can make with 64 bits, which means
9696
that the amount of different numbers that can be represented is
97-
limited. For N decimal ((digit))s, the amount of numbers that can be
98-
represented is 10^N^. Similarly, given 64 binary digits, you can
97+
limited. For _N_ decimal ((digit))s, the amount of numbers that can be
98+
represented is 10^_N_^. Similarly, given 64 binary digits, you can
9999
represent 2^64^ different numbers, which is about 18 quintillion (an
100-
18 with 18 zeroes after it). This is a lot.
100+
18 with 18 zeros after it). This is a lot.
101101

102102
Computer memory used to be a lot smaller, and people tended to use
103103
groups of 8 or 16 bits to represent their numbers. It was easy to
@@ -113,7 +113,7 @@ though. Those bits also store negative numbers, so one bit indicates
113113
the sign of the number. A bigger issue is that nonwhole numbers must
114114
also be represented. To do this, some of the bits are used to store
115115
the position of the decimal point. The actual maximum whole number
116-
that can be stored is more in the range of 9 quadrillion (15 zeroes),
116+
that can be stored is more in the range of 9 quadrillion (15 zeros),
117117
which is still pleasantly huge.
118118

119119
(((number,notation)))Fractional numbers are written by using a
@@ -134,7 +134,7 @@ number:
134134
2.998e8
135135
----
136136

137-
That is 2.998 × 10^8^ = 299800000.
137+
That is 2.998 × 10^8^ = 299,800,000.
138138

139139
(((pi)))(((number,precision of)))(((floating-point
140140
number)))Calculations with whole numbers (also called _((integer))s_)
@@ -169,7 +169,7 @@ values will apply it to those values and produce a new value.
169169
(((grouping)))(((parentheses)))(((precedence)))Does the example mean
170170
“add 4 and 100, and multiply the result by 11”, or is the
171171
multiplication done before the adding? As you might have guessed, the
172-
multiplication happens first. But, as in mathematics, you can change
172+
multiplication happens first. But as in mathematics, you can change
173173
this by wrapping the addition in parentheses.
174174

175175
[source,javascript]
@@ -187,7 +187,7 @@ they are applied is determined by the _((precedence))_ of the
187187
operators. The example shows that multiplication comes before
188188
addition. The `/` operator has the same precedence as `*`. Likewise
189189
for `+` and `-`. When multiple operators with the same precedence
190-
appear next to each other (as in `1 - 2 + 1`), they are applied left
190+
appear next to each other, as in `1 - 2 + 1`, they are applied left
191191
to right: `(1 - 2) + 1`.
192192

193193
These rules of precedence are not something you should worry about.
@@ -243,13 +243,13 @@ quotes between quotes might be hard. _Newlines_ (the characters you
243243
get when you press Enter) also can't be put between quotes. The string
244244
has to stay on a single line.
245245

246-
(((escaping,in strings)))(((backslash character)))To be able to have
246+
(((escaping,in strings)))(((backslash character)))To make it possible to include
247247
such characters in a string, the following notation is used: whenever
248-
a backslash (“\”) is found inside quoted text, it indicates that the
248+
a backslash (`\`) is found inside quoted text, it indicates that the
249249
character after it has a special meaning. This is called _escaping_
250250
the character. A quote that is preceded by a backslash will not end
251-
the string but be part of it. When an “n” character occurs after a
252-
backslash, it is interpreted as a newline. Similarly, a “t” after a
251+
the string but be part of it. When an `n` character occurs after a
252+
backslash, it is interpreted as a newline. Similarly, a `t` after a
253253
backslash means a ((tab character)). Take the following string:
254254

255255
[source,javascript]
@@ -328,7 +328,7 @@ console.log(- (10 - 2))
328328

329329
(((Boolean)))(((operator)))(((true)))(((false)))(((bit)))Often,
330330
you will need a value that simply distinguishes between two
331-
possibilities, like “yes” and “no”, or “on” and “off”. For this,
331+
possibilities, like “yes” and “no” or “on” and “off”. For this,
332332
JavaScript has a _Boolean_ type, which has just two values: true and
333333
false (which are written simply as those words).
334334

@@ -360,7 +360,7 @@ console.log("Aardvark" < "Zoroaster")
360360

361361
(((comparison,of strings)))The way strings are ordered is more or less
362362
alphabetic: uppercase letters are always “less” than lowercase ones,
363-
so `"Z" < "a"` is true, and nonalphabetic characters (!, -, and so on)
363+
so `"Z" < "a"` is true, and non-alphabetic characters (!, -, and so on)
364364
are also included in the ordering. The actual comparison is based on
365365
the _((Unicode))_ standard. This standard assigns a number to
366366
virtually every character you would ever need, including characters
@@ -382,8 +382,8 @@ console.log("Itchy" != "Scratchy")
382382
----
383383

384384
(((comparison,of NaN)))(((NaN)))There is only one value in JavaScript
385-
that is not equal to itself, and that is `NaN` (which stands for "not
386-
a number").
385+
that is not equal to itself, and that is `NaN`, which stands for not
386+
a number.
387387

388388
[source,javascript]
389389
----
@@ -619,4 +619,4 @@ operator (`?:`) to pick one of two values based on a third value.
619619
This gives you enough information to use JavaScript as a pocket
620620
calculator, but not much more. The
621621
link:02_program_structure.html#program_structure[next chapter] will
622-
start tying these basic expressions together into basic programs.
622+
start tying these expressions together into basic programs.

03_functions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ it is that you're trying to wrap. Let's go through an example.
715715

716716
(((farm example)))We want to write a program that prints two numbers,
717717
the numbers of cows and chickens on a farm, with the words `Cows` and
718-
`Chickens` after them, and zeroes padded before both numbers so that
718+
`Chickens` after them, and zeros padded before both numbers so that
719719
they are always three digits long.
720720

721721
----
@@ -742,7 +742,7 @@ printFarmInventory(7, 11);
742742

743743
(((length property,for strings)))(((while loop)))Adding `.length`
744744
after a string value will give us the length of that string. Thus, the
745-
`while` loops keep adding zeroes in front of the number strings until
745+
`while` loops keep adding zeros in front of the number strings until
746746
they are at least three characters long.
747747

748748
Mission accomplished! But just as we are about to send the farmer the

09_regexp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ might accidentally write something like `/([01]+)+b/`.
596596
image::img/re_slow.svg[alt="Visualization of /([01]+)+b/",width="6cm"]
597597

598598
(((inner loop)))(((nesting,in regexps)))If that tries to match some
599-
long series of zeroes and ones with no trailing _b_ character, the
599+
long series of zeros and ones with no trailing _b_ character, the
600600
matcher will first go through the inner loop until it runs out of
601601
digits. Then it notices there is no _b_, so it backtracks one
602602
position, goes through the outer loop once, and gives up again, trying

0 commit comments

Comments
 (0)