@@ -89,7 +89,7 @@ How does a program keep an internal ((state))? How does it remember
8989things? We have seen how to produce new values from old values, but
9090this does not change the old values, and the new value has to be
9191immediately used or it will dissipate again. To catch and hold values,
92- JavaScript provides a thing called a _ binding_ , or _ variable_ .
92+ JavaScript provides a thing called a _ binding_ , or _ variable_ :
9393
9494```
9595let caught = 5 * 5;
@@ -120,7 +120,7 @@ console.log(ten * ten);
120120When a binding points at a value, that does not mean it is tied to
121121that value forever. The ` = ` operator can be used at any time on
122122existing bindings to disconnect them from their current value and have
123- them point to a new one.
123+ them point to a new one:
124124
125125```
126126let mood = "light";
@@ -141,7 +141,7 @@ hold on to it or you reattach one of your existing tentacles to it.
141141
142142Let's look at another example. To remember the number of dollars that
143143Luigi still owes you, you create a binding. And then when he pays back
144- $35, you give this binding a new value.
144+ $35, you give this binding a new value:
145145
146146```
147147let luigisDebt = 140;
@@ -208,7 +208,7 @@ Words with a special meaning, such as `const`, are _((keyword))s_, and
208208they may not be used as binding names. There are also a number of
209209words that are "reserved for use" in ((future)) versions of
210210JavaScript, which also can't be used as binding names. The full list
211- of keywords and reserved words is rather long.
211+ of keywords and reserved words is rather long:
212212
213213``` {lang: "text/plain"}
214214break case catch class const continue debugger default
@@ -274,14 +274,14 @@ looks, but can be helpful in toy programs and experiments.
274274
275275{{index "JavaScript console", "developer tools", "Node.js", "console.log", output}}
276276
277- In examples, I used ` console.log ` to output values. Most JavaScript
277+ In the examples, I used ` console.log ` to output values. Most JavaScript
278278systems (including all modern web ((browser))s and Node.js) provide a
279279` console.log ` function that writes out its arguments to _ some_ text
280280output device. In browsers, the output lands in the ((JavaScript
281281console)). This part of the browser interface is hidden by default,
282- but most browsers open it when you press F12 or, on Mac, when you
283- press Command-Option-I. If that does not work, search through the
284- menus for an item named "developer tools" or similar.
282+ but most browsers open it when you press F12 or, on Mac, Command-Option-I.
283+ If that does not work, search through the menus for an item named "developer
284+ tools" or similar.
285285
286286{{if interactive
287287
@@ -615,15 +615,15 @@ amount.
615615
616616Many loops follow the pattern seen in the ` while ` examples. First, a
617617"counter" binding is created to track the progress of the loop. Then
618- comes a ` while ` loop, whose test expression usually checks whether the
618+ comes a ` while ` loop, usually with a test expression that checks whether the
619619counter has reached its end value. At the end of the loop body, the
620620counter is updated to track progress.
621621
622622{{index "for loop", loop}}
623623
624624Because this pattern is so common, JavaScript and similar languages
625625provide a slightly shorter and more comprehensive form, the ` for `
626- loop.
626+ loop:
627627
628628```
629629for (let number = 0; number <= 12; number = number + 2) {
@@ -938,7 +938,7 @@ following triangle:
938938{{index [ string, length] }}
939939
940940It may be useful to know that you can find the length of a string by
941- writing ` .length ` after it.
941+ writing ` .length ` after it:
942942
943943```
944944let abc = "abc";
@@ -1012,7 +1012,7 @@ number, so you'll have to create an `if`/`else if`/`else` chain.
10121012The second version of the program has a straightforward solution and a
10131013clever one. The simple way is to add another conditional "branch" to
10141014precisely test the given condition. For the clever method, build up a
1015- string containing the word or words to output, and print either this
1015+ string containing the word or words to output and print either this
10161016word or the number if there is no word, potentially by making good use
10171017of the ` || ` operator.
10181018
0 commit comments