Skip to content

Commit 77e046b

Browse files
committed
Index Chapter 19
1 parent d70c883 commit 77e046b

8 files changed

Lines changed: 446 additions & 301 deletions

File tree

03_functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ hint}}
10621062

10631063
### Bean counting
10641064

1065-
{{index "bean counting (exercise)", [string, indexing], "zero-based counting"}}
1065+
{{index "bean counting (exercise)", [string, indexing], "zero-based counting", ["length property", "for string"]}}
10661066

10671067
You can get the Nth character, or letter, from a string by writing
10681068
`"string"[N]`. The returned value will be a string containing only one

04_data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ equal to zero and below 10. Since `Math.floor` rounds down, this
11401140
expression will produce, with equal chance, any number from 0 through
11411141
9.
11421142

1143-
{{index "Math.ceil function", "Math.round function"}}
1143+
{{index "Math.ceil function", "Math.round function", "Math.abs function", "absolute value"}}
11441144

11451145
There are also the functions `Math.ceil` (for "ceiling", which rounds
11461146
up to a whole number), `Math.round` (to the nearest whole number), and

07_robot.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ If you're thinking in terms of ((object-oriented programming)), your
104104
first impulse is probably to start defining objects for the various
105105
elements in the world. A ((class)) for the robot, one for a parcel,
106106
maybe one for places. These could then hold properties that describe
107-
their current state, such as the pile of parcels at a location, which
108-
we could change when updating the world.
107+
their current ((state)), such as the pile of parcels at a location,
108+
which we could change when updating the world.
109109

110110
This is wrong.
111111

@@ -127,9 +127,9 @@ entire jungle.
127127

128128
quote}}
129129

130-
Instead, let's condense the village's state down to the minimal set of
131-
values that define it. There's the robot's current location and the
132-
collection of undelivered parcels, each of which has a current
130+
Instead, let's condense the village's ((state)) down to the minimal
131+
set of values that define it. There's the robot's current location and
132+
the collection of undelivered parcels, each of which has a current
133133
location and a destination address. That's it.
134134

135135
{{index "VillageState class", "persistent data structure"}}

15_event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ react to it as it occurs.
2121
{{index polling, button, "real-time"}}
2222

2323
Imagine an interface where the only way to find out whether a key on
24-
the keyboard is being pressed is to read the current state of that
24+
the ((keyboard)) is being pressed is to read the current state of that
2525
key. To be able to react to keypresses, you would have to constantly
2626
read the key's state so that you'd catch it before it's released
2727
again. It would be dangerous to perform other time-intensive
@@ -187,7 +187,7 @@ the event. This can be useful when, for example, you have a button
187187
inside another clickable element and you don't want clicks on the
188188
button to activate the outer element's click behavior.
189189

190-
{{index "mousedown event"}}
190+
{{index "mousedown event", "pointer event"}}
191191

192192
The following example registers `"mousedown"` handlers on both a
193193
button and the paragraph around it. When clicked with the right mouse

16_game.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ in the exercises of [Chapter ?](object#exercise_vector).
218218

219219
As the game runs, actors will end up in different places or even
220220
disappear entirely (as coins do when collected). We'll use a `State`
221-
class to track the state of a running game.
221+
class to track the ((state)) of a running game.
222222

223223
```{includeCode: true}
224224
class State {
@@ -635,7 +635,7 @@ defined earlier.
635635
.player { background: rgb(64, 64, 64); }
636636
```
637637

638-
{{index graphics, optimization, efficiency}}
638+
{{index graphics, optimization, efficiency, state}}
639639

640640
When it updates the display, the `drawState` method first removes the
641641
old actor graphics, if any, and then redraws them in their new

18_http.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ Objects in the `files` object have properties such as `name` (the
10061006
filename), `size` (the file's size in bytes), and `type` (the media
10071007
type of the file, such as `text/plain` or `image/jpeg`).
10081008

1009-
{{index "asynchronous programming", "file reading", "FileReader type"}}
1009+
{{index "asynchronous programming", "file reading", "FileReader class"}}
10101010

10111011
{{id filereader}}
10121012

@@ -1032,14 +1032,14 @@ avoid freezing the document.
10321032
</script>
10331033
```
10341034

1035-
{{index "FileReader type", "load event", "readAsText method", "result property"}}
1035+
{{index "FileReader class", "load event", "readAsText method", "result property"}}
10361036

10371037
Reading a file is done by creating a `FileReader` object, registering
10381038
a `"load"` event handler for it, and calling its `readAsText` method,
10391039
giving it the file we want to read. Once loading finishes, the
10401040
reader's `result` property contains the file's content.
10411041

1042-
{{index "error event", "FileReader type", "Promise class"}}
1042+
{{index "error event", "FileReader class", "Promise class"}}
10431043

10441044
_FileReader_s also fire an `"error"` event when reading the file fails
10451045
for any reason. The error object itself will end up in the reader's

0 commit comments

Comments
 (0)