Skip to content

Commit 75f5677

Browse files
committed
Edits in response to tech review of chapter 1
1 parent 2654f60 commit 75f5677

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

01_values.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ usually are:
8181
13
8282
----
8383

84-
(((binary)))Put that into a program, and it will cause the bit pattern
85-
for the number 13 to come into existence inside the computer.
84+
(((binary)))Use that in a program, and it will cause the bit pattern
85+
for the number 13 to come into existence inside the computer's memory.
8686

8787
JavaScript uses a fixed number of bits, namely 64 of them, to store a
8888
single number value. There are only so many patterns you can make with
@@ -477,11 +477,12 @@ console.log(false == 0)
477477

478478
When an operator is applied to the “wrong” type of value, it will
479479
quietly convert that value to the type it wants, using a set of rules
480-
that often aren't what you want or expect. So the `null` in the first
481-
expression becomes `0` and the `"5"` in the second expression becomes `5`
482-
(from string to number). Yet in the third expression, `+` tries
483-
string concatenation before numeric addition, and so the `1` is
484-
converted to `"1"` (from number to string).
480+
that often aren't what you want or expect. This is called _type
481+
coercion_. So the `null` in the first expression becomes `0` and the
482+
`"5"` in the second expression becomes `5` (from string to number).
483+
Yet in the third expression, `+` tries string concatenation before
484+
numeric addition, and so the `1` is converted to `"1"` (from number to
485+
string).
485486

486487
When something that doesn't map to a number in an obvious way (such as
487488
`"five"` or `undefined`) is converted to a number, the value `NaN` is

0 commit comments

Comments
 (0)