@@ -22,7 +22,7 @@ data—but anything that isn't data simply does not exist. All this data
2222is 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
2626such as a high or low electrical charge, a strong or weak signal, or a
2727shiny or dull spot on the surface of a CD. Any piece of discrete
2828information can be reduced to a sequence of zeros and ones and thus
@@ -94,10 +94,10 @@ memory.
9494number of bits, namely 64 of them, to store a single number value.
9595There are only so many patterns you can make with 64 bits, which means
9696that 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
9999represent 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
102102Computer memory used to be a lot smaller, and people tended to use
103103groups 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
113113the sign of the number. A bigger issue is that nonwhole numbers must
114114also be represented. To do this, some of the bits are used to store
115115the 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 ),
117117which is still pleasantly huge.
118118
119119(((number,notation)))Fractional numbers are written by using a
@@ -134,7 +134,7 @@ number:
1341342.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
140140number)))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
171171multiplication 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
173173this by wrapping the addition in parentheses.
174174
175175[source,javascript]
@@ -187,7 +187,7 @@ they are applied is determined by the _((precedence))_ of the
187187operators. The example shows that multiplication comes before
188188addition. The `/` operator has the same precedence as `*`. Likewise
189189for `+` 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
191191to right: `(1 - 2) + 1`.
192192
193193These rules of precedence are not something you should worry about.
@@ -243,13 +243,13 @@ quotes between quotes might be hard. _Newlines_ (the characters you
243243get when you press Enter) also can't be put between quotes. The string
244244has 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
247247such 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
249249character after it has a special meaning. This is called _escaping_
250250the 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
253253backslash 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,
330330you 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,
332332JavaScript has a _Boolean_ type, which has just two values: true and
333333false (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
362362alphabetic: 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)
364364are also included in the ordering. The actual comparison is based on
365365the _((Unicode))_ standard. This standard assigns a number to
366366virtually 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.
619619This gives you enough information to use JavaScript as a pocket
620620calculator, but not much more. The
621621link: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.
0 commit comments