*= operator, 34
{} (block), 29
-- operator, 34
-= operator, 34
for default value, 48
== operator, 17, 19, 66, 80, 193
=== operator, 19, 80, 113, 410
!= operator, 17
!== operator, 19
/= operator, 34
> operator, 16
>= operator, 17
< operator, 16
<= operator, 17
% operator, 14, 33, 297, 407, 408, 418, 420
+ operator, 13, 15, 19, 148, 404
++ operator, 34
[] (array), 60
|| operator, 17, 20, 51, 95, 328, 408
2d (canvas context), 289
200 (HTTP status code), 312, 360, 364
204 (HTTP status code), 366, 367
304 (HTTP status code), 374, 380, 386
400 (HTTP status code), 425
403 (HTTP status code), 364
404 (HTTP status code), 312, 365, 377–379
405 (HTTP status code), 316, 364
406 (HTTP status code), 422
500 (HTTP status code), 364
a (HTML tag), 222, 235, 237, 320, 344
Abelson, Hal, 202
absolute positioning, 240, 244, 253, 257, 262
abstract data type, 96
abstract syntax tree, see syntax tree
abstraction, 5, 41, 84, 86, 203, 316, 349
in Egg, 230
of the network, 221
access control, 98, 141–142, 375
Access-Control-Allow-Origin header, 316
activeElement property, 319
add method, 113
addEntry function, 66
addEventListener method, 248, 282, 362
adoption, of tools and techniques, 145
ages example, 104
algorithmic optimization, 397, 406
alpha, 346
alphanumeric character, 147
alt attribute, 233
ALT key, 252
altKey property, 252
ambiguity, 215
American English, 148
ancestor element, 275
Android, 252
angle brackets, 222
animation, 256, 262, 271, 306, 419
performance, 266
platform game 277, 283, 296, 297, 303, 305
anyStorage function, 198–199, 200
Apple, 225
application (of functions), see function
application applications, 1, 333, 372
argument, 27, 47, 51, 74, 155, 204
arguments object, 409
argv property, 355
counting, 93
creation, 91, 60, 336, 409, 413
in Egg, 214
filtering, 88
indexing, 60, 68, 72, 409, 418
length of, 61
methods, 71, 79, 87–89, 92, 94, 95
notation, 77
random element, 122
as regular expression match, 149
representation, 77
of rest arguments, 74
as table, 67
Array constructor, 336
Array.from function, 195, 231, 356
array-like object, 230–232, 255, 320, 325, 358
arrays in Egg (exercise), 214, 416
arrow keys, 262
artificial intelligence, 117, 213
assert function, 140
assertion, 140
assignment, 25, 34, 160, 162, 215, 417
async function, 195–196, 199, 200, 386
asynchronous programming, 181, 200
animation, 284
in Node.js, 354, 359, 361, 365, 368
reading files, 325
attribute, 222, 230, 235, 320, 337, 422
autofocus attribute, 320
automatic semicolon insertion, 24
automaton, 117
avatar, 266
average function, 91
await keyword, 195–196, 197, 199
Babbage, Charles, 58
background (CSS), 262, 266, 274
backslash character
as path separator, 365
in regular expressions, 146, 147, 157, 158, 414
backtracking, 153–154, 156–157
banking example, 137
Banks, Iain, 264
baseControls constant, 348
baseTools constant, 348
bean counting (exercise), 56, 409
beforeunload event, 258
Berners-Lee, Tim, 218
best practices, 3
bezierCurveTo method, 292
binary numbers, 11, 12, 68, 133, 153, 324
binding
destructuring, 76
exported, 173
global, 43, 130, 285, 354, 355
local, 43
scope of, 43
as state, 31, 33, 65, 160, 326
undefined, 138
visibility, 43
bitfield, 255
block, 29, 32, 42, 43, 46, 63, 136, 137, 204
blur method, 319
body (HTTP), 313–315, 360, 366, 367, 378
body property, 228, 229, 231, 316
bold, 237 Book of Programming, The, 10, 352
Boolean, 16, 28, 31, 65, 146, 209, 210
Boolean function, 28
border-radius (CSS), 253
bouncing, 267, 270, 278, 280, 308
boundary, 151, 153, 157, 161, 164, 302, 413
bounds, of ranges, 88
box shadow (CSS), 275
braces
class, 102
in regular expression, 148
breakpoint, 134
British English, 148
broadcastConnections function, 193
browser, 2, 5, 174, 183, 219–225, 266, 267, 308, 313, 316, 321, 344, 348, 372
window, 248
browser wars, 225
bubbling, see event propagation
Buffer class, 358, 359, 361, 362
bug, 83, 129, 133, 157, 159, 164, 168, 225
building Promise.all (exercise), 200, 416
bundlers, 174
button (HTML tag), 224, 248, 252, 262, 321, 327, 330, 337
button property, 249, 255, 338
C (programming language), 391
call protocol, 400
call stack, 46–47, 51, 62, 135, 136, 138, 197, 400
callback functions, 184–190, 247, 283, 337, 358–359, 361, 380, 385
calling (of functions), see function application camel case, 35, 238
cancelAnimationFrame function, 260
canvas, 266, 287, 289–292, 295–301, 305–307, 395, 421
context, 289
path, 290
canvas (HTML tag), 288, 334, 337, 344, 345, 349, 423
CanvasDisplay class, 301, 302, 304
capitalization, 35, 101, 149, 238, 243, 362
capture group, 149–151, 155, 376
career, 265
caret character, 147, 151, 161, 358
carriage return, 161
cascading, 238
Cascading Style Sheets, see CSS case conversion, 62
case keyword, 35
casual computing, 2
cat’s hat (exercise), 244
catch keyword, 135–136, 138–139, 141, 197, 413
catch method, 188
CD, 11
cell, 330
Celsius, 110
centering
image on screen, 241
player in viewport, 276
certificate, 317
change event, 319, 322, 340, 422, 425
character category, 163
characterCount function, 90
characterScript function, 94, 95, 411
charCodeAt method, 92
chessboard (exercise), 38, 408
childNodes property, 230, 231, 233, 419
children property, 231
choice, 152
Chrome, 225, 398, 400, 402, 404
circle (SVG tag), 288
circus, 71
class, 101, 102, 113, 119, 267, 335
class attribute, 232, 235, 239, 273, 275
class declaration, 102
class hierarchy, 112
className property, 235
cleaning up, after exceptions, 136
clearing, the canvas, 288, 296, 301, 302, 421
clearInterval function, 260
clearTimeout function, 259, 260
click event, 248, 250, 253, 255, 337, 422
client, 220, 316, 361, 372, 381, 382
clientHeight property, 235
clientWidth property, 235
clientX property, 253, 255, 339
clientY property, 253, 255, 339
clipboard, 225
clipping, 302
closePath method, 291
closure in Egg (exercise), 214, 417
structure of, 23, 32, 41, 167, 175
code golf, 164
code unit, 92
codePointAt method, 93
collaboration, 219
collision detection, 277, 278, 280–282, 420, 421
colon character, 18, 34, 63, 237
color, 288, 290, 302, 334, 346
color codes, 336
color property, 335
ColorSelect class, 341
comma character, 204
command line, 169, 353–355, 368
comment, 35, 77, 156, 160, 214, 229, 372, 374, 379, 384, 417
comment field reset (exercise), 388, 426
COMMENT_NODE code, 229
comments in Egg (exercise), 214, 417
CommonJS modules, 171–173, 355–356
community, 354
compareRobots function, 125
comparison, 16, 19, 31, 35, 80
of NaN, 17
of objects, 66
of strings, 16
of undefined values, 19
compatibility, 5, 219, 225, 350, 357
compilation, 174, 212, 213, 391, 392, 398, 400, 403, 417
complexity, 3, 83, 112, 154, 239, 272, 349
concat method, 72, 95, 413, 418, 426
conditional execution, 18, 28, 34, 37, 209
conditional operator, 18, 20, 209
conditional request, 374
configuration, 160
connected graph, 125
connection, 220, 311, 317, 372, 373
connections binding, 192
console.log function, 5, 8, 16, 27, 46, 48, 55, 133, 354, 362–363, 398
const keyword, 25–26, 43, 65, 75, 76
constructor, 35, 101, 102, 112, 126, 130, 136, 150, 157, 411, 413
content negotiation (exercise), 329, 422
Content-Length header, 313
Content-Type header, 313, 360, 365, 369
context, 289
context menu, 251
continuation, 184
continue keyword, 33
control flow
convention, 35
convergent evolution, 184
Conway’s Game of Life, 330
coordinates, 113, 241–242, 253, 273, 276, 278, 279, 289, 293, 298
copy-paste programming, 53, 168
copyright, 169
corvid, 183
counter variable, 30, 32, 242, 408, 409, 416, 418
CPU, 182
createElement method, 234, 336, 417
createReadStream function, 362, 365
createServer function, 360, 362, 375, 376
createTextNode method, 233, 422
createWriteStream function, 361, 367
cross-domain request, 316
crow-tech module, 185
crying, 149
cryptography, 317
CSS, 237–239, 273–277, 287, 290, 336, 382
curl program, 367
curly braces, see braces cursor, 322
cutting point, 272
cycle, 229
Dark Blue (game), 265
data event, 362
data loss, 387
data structure, 59, 175, 177, 306, 330
collection, 60
immutable, 120
list, 79
map, 104
stack, 62
Date class, 150, 151, 169, 171
date-names package, 171
Date.now function, 151, 346, 405
dblclick event, 253
De Morgan’s laws, 411
debouncing, 260
debugger statement, 134
debugging, 6, 129–131, 133, 136, 139, 140, 164
decentralization, 219
declaration, 237
decodeURIComponent function, 314, 364, 376
deep comparison (exercise), 80, 410
default export, 173
default keyword, 35
default value, 20, 48, 290, 328, 348
defineProperty function, 411
defineRequestType function, 185, 190
delete method, 113
DELETE method, 312–313, 315, 363, 366, 378
delete operator, 63
dependence, 66
dependency, 168, 170, 173, 178, 224, 357
deserialization, 77
design, 168
destructuring, 151
destructuring assignment, 424
destructuring binding, 76, 171, 348, 415
developer tools, 7, 27, 134, 138
dialect, 174
dialog box, 26
digit, 11, 12, 133, 147–149, 336
Dijkstra’s algorithm, 176
dimensions, 113, 235, 265, 267, 278, 289, 401, 408
dinosaur, 213
direct child node, 239
direction (writing), 95
directory, 355, 358–359, 363, 365–366, 368, 425
directory creation (exercise), 368, 425
disabled attribute, 320
dispatch, 34, 334–336, 340, 347, 375, 423
display, 272, 273, 283, 284, 301, 305, 306
distribution, 392
division by zero, 14
Document Object Model, see DOM
documentation, 353
documentElement property, 228, 229
dollar sign, 26, 151, 155, 161
attributes, 235
components, 334
construction, 230, 232, 234, 336
graphics, 266, 267, 273–276, 287, 288, 305
tree, 229
dom property, 335
domain-specific language, 84, 132, 145, 214, 239
dominant direction (exercise), 95, 411
done property, 346
doneAt property, 346
dot character, see period character
double-click, 253
double-quote character, 14, 165, 204, 223
download, 7, 169, 344, 356, 367, 371, 387
download attribute, 344
draggable bar example, 254
drawGraph function, 395
drawImage method, 295–296, 298, 301, 303, 421
drawing, 227, 235, 236, 241, 272, 273, 288, 289, 292, 299, 303, 305, 333, 334, 422
drawing program example, 253, 333
drawPicture function, 338, 344, 350, 423
duplication, 168
dynamic typing, 403
economic factors, 349
ecstatic package, 376
editor, 32
efficiency, 50, 79, 91, 192, 212, 236, 266, 275, 289, 338, 349
efficient drawing (exercise), 349, 423
electronic life, 266
elements property, 320
else keyword, 29
elt function, 234, 336, 349, 384
email, 317
empty set, 156
encapsulation, 97, 98, 105, 112, 248, 272
encodeURIComponent function, 314, 373–374, 383
encoding, 220
encryption, 317
end event, 362
enemies example, 160
engineering, 225
ENOENT (status code), 365
ENTER key, 321
entity, 223
enum (reserved word), 26
equality, 17
error, 92, 129, 130, 133–135, 138, 139, 187, 188, 194
error handling, 129, 135, 138, 359, 364, 365, 383, 386
error recovery, 134
error tolerance, 223
Error type, 136, 138, 139, 365
ESC key, 285
escaping
in regular expressions, 146, 147, 158
in URLs, 314, 364, 373–374, 376
Escher, M.C., 286
eval operator, 170
evaluate function, 207–208, 210
event handling, 247–262, 266, 282, 284, 285, 295–296, 305, 321, 322, 337, 362, 419, 422
event loop, 197
event propagation, 249, 250, 257, 258
event type, 249
every method, 95
everything (exercise), 95, 411
everywhere function, 192
exception handling, 135, 136, 138–142, 187, 188, 196, 197, 200, 416, 422
exception safety, 138
exec method, 149–150, 158, 160
exit method, 354
expectation, 251
exploit, 225
export keyword, 173
exports object, 171–173, 356, 415
expression, 23, 24, 27, 31, 33, 44, 203, 204, 208
expressivity, 214
extension, 355
extraction, 150
factorial function, 8
Fahrenheit, 110
fallthrough, 35
false, 16
fetch function, 315, 329, 361, 383, 385, 425
field, 252, 313, 318, 320, 323, 326, 330, 334, 388
Fielding, Roy, 310
access, 172, 174, 345, 358, 359
resource, 312, 313, 363, 365, 366
stream, 361
file extension, 365
file format, 160
file reading, 325
file server, 381
file server example, 363, 365–369, 425
file size, 174
file system, 325, 358, 359, 363, 364, 425
File type, 325
FileReader class, 325, 326, 345
files property, 325
fill function, 343
fillColor property, 336
filter method, 88, 91, 94, 120, 191, 411, 413
finally keyword, 137, 142, 413
findIndex method, 94
findInStorage function, 194, 195
finish event, 367
Firefox, 225, 398, 400, 402, 404
firewall, 372
firstChild property, 230
fixed positioning, 257
fixing scope (exercise), 215, 417
flattening (exercise), 95
flexibility, 6
flipHorizontally function, 304, 420
flipHorizontally method, 298
flooding, 192
focus, 252, 257, 319, 320, 322, 323, 349, 388
focus method, 319
fold, see reduce method font, 295
font-family (CSS), 238
font-size (CSS), 262
font-weight (CSS), 238
for attribute, 323
for loop, 32, 33, 69, 85, 95, 139, 397, 409, 410
for/of loop, 69, 93, 106, 107, 109, 398, 412
force-directed graph layout, 393
forceDirected_noRepeat function, 397
forceDirected_noVector function, 401
forceDirected_simple function, 396
forceDirected_skip function, 398
forEach method, 87
form (HTML tag), 318, 320, 385, 425
form property, 320
fractal example, 300
fractional numbers, 13, 165, 266
fragmentation, 402
frequency table, 67
Fuller, Margaret, 370
function, 5, 26, 41, 45, 130, 203, 204, 211
application, 26, 27, 42, 46, 47, 50, 74, 88, 138, 203, 208
callback, see callback function
declaration, 45
higher-order, 45, 85, 86, 88, 89, 91, 155, 283
inlining, 400
model of, 49
as property, 62
purity, 55
as value, 42, 44, 48, 85, 86, 88, 249, 283, 419
Function constructor, 170, 172, 210, 213, 330, 422
future, of JavaScript, 6, 26, 45, 308
game, 265–267, 282, 284, 285, 301
with canvas, 305
game of life (exercise), 330, 422
GAME_LEVELS data set, 284
garbage collection, 12, 400–403
garble example, 355
gardening, 371
gaudy home pages, 262
generational garbage collection, 403
generator, 196
get method, 105
GET method, 312, 313, 315, 321, 361, 363, 365, 373, 377–378
getAttribute method, 235
getBoundingClientRect method, 236, 339
getContext method, 289
getDate method, 151
getElementById method, 232, 417
getElementsByClassName method, 232
getElementsByTagName method, 232, 233, 243, 418
getFullYear method, 151
getHours method, 151
getMinutes method, 151
getMonth method, 151
getPrototypeOf function, 100, 101, 215, 417
getSeconds method, 151
getTime method, 150
getYear method, 151
GitHub, 312
global object, 130
global scope, 43, 170, 210, 259, 354, 355, 417
goalOrientedRobot function, 125
Google, 225
gossip property, 192
graph, 118, 124, 176, 193, 306, 392, 394, 405
graph layout, 393, 394, 397, 398, 400
graphics, 266, 272, 275, 287–289, 295, 305, 306
grave accent, see backtick gravity, 282
greater than, 16
grep, 368
grid, 266, 273, 278–279, 330, 422
Group class, 113, 114, 126, 197, 411, 412
groupBy function, 95
grouping, 13, 29, 149, 155, 413
groups (exercise), 113, 114, 411, 412
hack, 173
handleAction function, 382
hard drive, 12, 325, 327, 353, 387
hasOwnProperty method, 105, 215, 417
head (HTML tag), 222, 223, 228
head property, 228
headers property, 315, 316, 329
help text example, 257
hexadecimal numbers, 153, 314, 336, 346
Hières-sur-Amby, 183
higher-order functions, see function, higher-order
historyUpdateState function, 346
Hoare, C.A.R., 82
Hooke’s law, 395
hooligan, 375
Host header, 313
hot code, 392
notation 221
structure 227
HTTP, 219–221, 311–317, 366, 367, 369, 373,
https package, 361
human language, 23
Hypertext Markup Language, see HTML
Hypertext Transfer Protocol, see HTTP
hyphen character, 13, 147, 238
identifier, 204
identity, 65
If-None-Match header, 374, 380, 385
imagination, 265
IME (input method editor), 252
img (HTML tag), 222, 233, 237, 258, 287, 295, 296, 345
immutable, 65, 120, 270, 335, 336, 342, 346, 423
implements (reserved word), 26
import keyword, 173
includes method, 68, 69, 399, 411
indentation, 32
index, 61
index property, 149
index.html file, 381
index.js file, 355
indexOf method, 71, 73, 94, 113, 146, 158, 411
infinite loop, 33, 47, 139, 409
infinity, 14
infrastructure, 169
inheritance, 100, 111–112, 139, 365
INI file, 160
ini package, 169, 173, 175, 356
initialization, 258
inlining, 400
inner loop, 154
innerHeight property, 257
innerWidth property, 257
input, 134, 247, 266, 319, 353, 378
input (HTML tag), 257, 318, 322, 323, 325, 341, 345
input event, 322
installation, 169
instance, 101
integers, 13
interface, 98
design, 54, 145, 150, 155, 158, 229, 230, 272, 290
module, 168–172, 175, 315, 356
object, 105, 106, 109, 114, 126, 189, 269, 301, 322, 335
interface (reserved word), 26
internationalization, 162
Internet Explorer, 225
interpolation, 15
interpretation, 7, 170, 207–208, 212, 391
interview question, 37
inversion, 147
invoking (of functions), see function application
iterator, 196
iterator interface, 106, 107, 114, 398
Jacques, the weresquirrel, 60
Java, 5
JavaScript, 5
availability of, 2
flexibility of, 6
in HTML, 223
syntax, 23
uses of, 6
versions of, 6
weaknesses of, 6
JavaScript console, 7, 16, 27, 134, 138, 330, 354
JavaScript Object Notation, see JSON
JOURNAL data set, 68
journalEvents function, 69
JSON, 77, 175, 184, 193, 315, 328, 373, 386, 425
json method, 315
JSON.stringify function, 77
JSX, 384
jump, 4
jump-and-run game, 265
just-in-time compilation, 392
Kernighan, Brian, 128
key code, 282
keyboard, 26, 247, 251, 266, 281, 282, 285, 319, 320, 322, 349
keyboard bindings (exercise), 349, 423
keyboard focus, see focus
keydown event, 251, 260, 282, 349, 418, 423
Khasekhemwy, 322
kill process, 360
Knuth, Donald, 40
labeling, 323
landscape example, 44
Laozi, 180
lastChild property, 230
lastIndexOf method, 71
Last-Modified header, 313
latency, 174
lava, 266, 267, 275, 278, 280, 305
laziness, 236
Le Guin, Ursula K., 2
leaf node, 229
LEGO, 168
length property
for strings, 53, 56, 61, 74, 409
less than, 16
let keyword, 24, 25, 43, 65, 75, 76, 130
level, 266, 267, 273, 275, 284
Level class, 267
lexical scoping, 44
license, 169
line, 24, 32, 161, 287, 289–294, 307, 420
lines of code, 211
lineWidth property, 290
link (HTML tag), 277
links, 222, 230–231, 251, 252, 344
linter, 173
Liskov, Barbara, 96
listen method, 360
literal expression, 23, 146, 206, 208
live data structure, 227, 233, 240, 419
lives (exercise), 285
load event, 258, 295–296, 303, 326, 421
LoadButton class, 344
localhost, 360
localStorage object, 326–327, 383
locked box (exercise), 141, 413
logging, 133
logical operators, 17
long polling, 372–374, 378, 380, 385
loop, 4, 30, 32, 37, 38, 50, 69, 85, 90, 91, 160, 189, 408, 409, 420
termination of, 33
macro-optimization, 406
mailRoute array, 123
maintenance, 169
malicious script, 224
man-in-the-middle, 317
map (data structure), 104
map method, 88, 91, 94, 99, 104, 120, 191, 268, 340
Marcus Aurelius, 246
matching, 146, 151, 152, 158, 164
Math.acos function, 75
Math.asin function, 75
Math.atan function, 75
Math.ceil function, 76, 278, 302–303
Math.cos function, 75, 241, 242, 421
Math.floor, 76, 122, 278, 302–303
Math.max function, 27, 61, 74, 75, 302
Math.min function, 27, 56, 75, 302
Math.random function, 75, 122, 271, 330, 404
Math.round function, 76
Math.sin function, 75, 241, 242, 271, 281
Math.sqrt function, 68, 75, 411
Math.tan function, 75
MatrixIterator class, 108
McConnell, Steve, 390
Meadowfield, 117
measurement, 397
measuring, 399
measuring a robot (exercise), 125, 412
meetups, JavaScript, 371
call stack, 24
organization, 12, 47, 60, 65, 77
persistence, 387
speed, 181, 213, 400, 402, 406
structure sharing, 79
mesh, 221
message event, 259
meta key, 252
array, 71
HTTP, 312, 317, 360, 367, 373, 375
interface, 98
method attribute, 313
method call, 98
method property, 315
methods object, 363
micro-optimization, 397, 399, 406
Microsoft, 225
Middle East, graph of, 393
mime package, 365
mini application, 326
minifiers, 175
minimalism, 265
Miró, Joan, 332
modification date, 366
modifier key, 252
modular robot (exercise), 177, 414
module, 168, 169, 177, 272, 355, 356, 375
design, 175
module loader, 355
module object, 172
module system, 169
modulo (remainder) operator, 14, 33, 297, 407, 408, 418, 420
Mongolian vowel separator, 162
Mosaic, 225
motion, 266
mouse, 26
cursor, 253
mouse trail (exercise), 262, 418
mousedown event, 250, 253, 255, 337, 338, 422
mousemove event, 254, 260–262, 338, 350, 418
Mozilla, 225
multiple-choice, 318–319, 323, 324
multiplication, 13, 269–270, 280
multiplier function, 49
music, 265
namespace, 75
NaN (not a number), 14, 17, 18, 130
neighbors property, 190
nerd, 158
nesting
of arrays, 67
of functions, 44
in regular expressions, 154
of scope, 44
protocol, 220
reliability, 188
security, 317
network function, 194
new operator, 101
newline character, 14, 38, 147, 156, 161, 268, 422
nextSibling property, 230
Nietzsche, Friedrich, 226
node program, 354
node-fetch package, 361
Node.js, 6, 7, 27, 171, 183, 353–369, 372, 373, 375, 387, 398
node_modules directory, 355, 356
nodeName property, 243
nodeType property, 229, 418, 419
nodeValue property, 231
nonbreaking space, 162
normalizing, 396
not a number (NaN), 14, 17, 18, 129
notation, 173
note-taking example, 327
notification, 372
NPM, 169, 171, 173, 174, 176, 177, 355–358, 365, 375, 376, 387, 415
null, 18, 19, 51, 61, 77, 80, 134
precision of, 13
representation, 12
special values, 14
Number.isNaN function, 29
creation, 77, 101, 328, 401, 403
identity, 65
as map, 272
as module, 169
mutability, 65
representation, 77
object shape, 404
Object.assign function, 328, 336
Object.create function, 100, 104, 211
Object.keys function, 64, 80, 195, 410, 417
object-oriented programming, 97, 101, 105, 106, 111, 119, 175
Object.prototype, 104
observation, 399
offsetHeight property, 235, 236
offsetWidth property, 235
on method, 362
onclick property, 337
OpenGL, 289
opening tag, 222
operator, 13, 16, 19, 204, 210, 404
application, 13
optimization, 50, 55, 236, 260, 266, 275, 306, 308, 359, 392, 398–400, 403, 406, 426
option (HTML tag), 319, 324, 425
optional, in pattern, 148
options property, 324
ordering, 220
organic growth, 167
organization, 167
outline, 289
output, 16, 26, 27, 133, 134, 211, 353, 422
overflow, with numbers, 12
overlap, 278
overlay, 238
overriding, 103, 105, 111, 415
package (reserved word), 26
package manager, 169
package.json file, 357
padding (CSS), 274
pageXOffset property, 236
pageYOffset property, 236, 257
Palef, Thomas, 265
panning, 339
paragraph, 222
parameter, 27, 42, 43, 46–48, 74, 76, 99, 131, 172
parent node, 249
parentheses
arguments, 23, 41, 46, 85, 204
expression, 13
in regular expressions, 149, 151, 152, 162, 413
parentNode property, 230
parse function, 207
parseApply function, 206
parseExpression function, 205
parsing, 77, 129, 161, 203–206, 208, 211, 223, 227, 364, 380
password, 317
password field, 318
path
closing, 291
URL, 312, 315, 363, 364, 373, 375
path package, 365
pathfinding, 123, 176, 193, 343
pathfinding (exercise), 405, 406, 426
patience, 350
pea soup, recipe analogy, 84
peanuts, in weresquirrel example, 70–71
percent sign, 314
performance, 154, 174, 212, 236, 266, 306, 359, 391, 393, 397, 399
period character, 27, 61, 74, 147, 156, 165, 336
persistence, 326, 372, 387, 425
persistent data structure, 119, 120, 126, 132, 335, 342, 346, 419
persistent group (exercise), 126
persistent map (exercise), 413
phone, 252
physics engine, 278
pick function, 343
picture, 287, 288, 296, 306, 334, 346
picture property, 335
pictureFromImage function, 345
pie chart example, 294, 295, 307, 420
ping request, 190
pink, 336
pipe analogy, 220
pipeline, 175
pixel, 235, 242, 253, 267, 273, 288, 289, 295, 296, 302, 306, 308, 333, 335, 339, 342, 343, 345, 350, 423
pixel art, 296
PixelEditor class, 340, 347, 349
pizza, in weresquirrel example, 67
Plauger, P.J., 128
player, 265–267, 275, 278, 281, 284, 296, 303, 305
pointer, 230
pointerPosition function, 338
polling, 247
pollTalks function, 385
Popper, Karl, 234
pose, 296
position, of elements on screen, 236
position (CSS), 240, 244, 257, 266, 275
POST method, 313, 314, 321, 374
postMessage method, 259
predicate function, 88, 92, 95
premature optimization, 50
preventDefault method, 251, 256–258, 282, 321, 339, 423
previousSibling property, 230
primitiveMultiply (exercise), 141, 413
privacy, 225
private (reserved word), 26
private properties, 98, 141–142
process object, 354–355, 364–365
program size, 83, 84, 164, 272
programming, 1
difficulty of, 2
history of, 3
Programming Is Terrible, 166
DOM, 229
history of, 3
machine language and, 391
Node.js and, 354
power of, 5
programming style, 3, 24, 32, 35, 272
progress bar, 256
project chapter, 117, 203, 265, 333, 371
Promise class, 186, 187, 189, 195, 197, 198, 200, 315, 326, 359, 361, 363, 386, 416
Promise.all function, 190, 199, 200, 416
Promise.reject function, 187
Promise.resolve function, 186, 190
promises package, 359
promptDirection function, 139
promptInteger function, 134
propagation, of events, 249, 250, 257, 258
proper lines (exercise), 350, 424
property
assignment, 63
model of, 63
testing for, 64
protected (reserved word), 26
prototype, 99–104, 111, 211, 215, 417, 426
diagram, 103
prototype property, 101
pseudorandom numbers, 75
public (reserved word), 26
public properties, 98
public space (exercise), 369, 425
publishing (packages), 358
punch card, 3
pure function, 55, 79, 88, 175, 330, 422
push method, 62, 69, 71, 411, 426
pushing data, 372
PUT method, 312–313, 363, 367, 373, 378, 425
Python, 391
quadratic curve, 292
quadraticCurveTo method, 292, 420
querySelector method, 240, 417
querySelectorAll method, 239, 324
question mark, 18, 148, 157, 314
queue, 198
quoting
in JSON, 77
of object properties, 63
quoting style (exercise), 165, 413
radix, 11
raising (exceptions), 135
random-item package, 414
randomPick function, 122
randomRobot function, 122
Range header, 316
ray tracer, 306
readability, 4, 5, 35, 50, 54, 135, 167, 208, 276, 307
readable stream, 361, 362, 364, 378
readAsDataURL method, 345
readAsText method, 326
readdir function, 359, 366, 425
readdirSync function, 425
read-eval-print loop, 354
readFile function, 172, 358, 425
readFileSync function, 359, 424
readStorage function, 184
real-time events, 247
reasoning, 17
recipe analogy, 84
record, 62
rect (SVG tag), 288
rectangle, 266, 278, 289, 307, 342
recursion, 47, 50, 56, 80, 189, 195, 205, 206, 208, 231, 243, 300, 394, 408, 410, 413, 416, 418
reduce method, 89, 91, 94, 95, 340, 411
redundancy, 397
ReferenceError type, 215
regexp golf (exercise), 164
regular expressions, 145–165, 206, 368, 375, 376, 417, 424
alternatives, 152
backtracking, 153
boundary, 151
internationalization, 162
repetition, 148
rejecting (a promise), 187, 189, 198
relative path, 172, 224, 355, 363, 425
relative positioning, 240, 241
relative URL, 315
remainder (modulo) operator, 14, 33, 297, 407, 408, 418, 420
remote access, 363
remote procedure call, 316
removeChild method, 232
removeEventListener method, 248, 419
removeItem method, 326
rename function, 359
rendering, 289
renderTalk function, 384
renderTalkForm function, 385
renderUserField function, 383
repeating key, 251
repetition, 52, 148, 154, 157, 260
replaceSelection function, 322
reportError function, 383
request, 185, 189, 220, 312, 313, 321, 360, 361, 367, 372
request function, 189, 361, 362
request type, 185
requestAnimationFrame function, 241, 258, 260, 283, 308, 418
requestType function, 190
require function, 171, 172, 178, 355, 356, 365, 375
reserved words, 26
resolve function, 364
resolving (a promise), 186, 187, 189, 198
resource, 220, 221, 312, 313, 317, 363, 377
response, 185, 189, 312, 313, 316, 360, 364, 366
Response class, 315
responsiveness, 247, 353, rest parameters, 74
result property, 326
retry, 189
return keyword, 42, 47, 101, 196, 408, 411
return value, 27, 42, 134, 185, 410
reverse method, 79
rgb (CSS), 274
right-aligning, 243
roadGraph object, 118
roads array, 117
roads module (exercise), 177, 415
robot, 117, 119, 121, 123, 125, 177
robot efficiency (exercise), 125, 412
robustness, 373
root, 229
rounding, 76, 134, 278, 279, 302, 424
routeRequest function, 194
routeRobot function, 123
routing, 192
rows, in tables, 243
Ruby, 391
run function, 211
runAnimation function, 283, 285
runLayout function, 396
running code, 7
run-time error, 132–134, 140, 417
Rust (programming language), 391
Safari, 225
SaveButton class, 344
scalar replacement of aggregates, 400, 402
scaling, 273, 296, 297, 303, 421
scope, 43, 44, 48, 168, 170–173, 208, 210, 214, 215, 417
script (HTML tag), 223, 224, 258
SCRIPTS data set, 87, 89, 92, 93, 95
scrolling, 251, 256–257, 275–276, 282, 301
search method, 158
search problem, 124, 152, 154, 232, 368, 405
search tool (exercise), 368, 424
section, 161
security, 224, 225, 316, 317, 325, 327, 364, 375
select (HTML tag), 319, 324, 327, 334, 340, 425
selected attribute, 324
selection, 322
selectionEnd property, 322
selectionStart property, 322
selector, 239
self-closing tag, 222
semantic versioning, 357
sendGossip function, 191
sequence, 148
serialization, 77
server, 220, 221, 311–313, 315, 316, 353, 360, 362, 363, 372, 375
session, 328
sessionStorage object, 328
Set (data structure), 113, 126
set method, 105
setInterval function, 260, 296
setItem method, 326
setter, 110
setTimeout function, 184, 197, 259, 260, 380, 386
shape, 287, 290, 291, 293, 295, 307
shift method, 71
shiftKey property, 252
short-circuit evaluation, 20, 51, 209, 411
SICP, 202
side effect, 24, 27, 34, 42, 54, 65, 79, 88, 159, 175, 199, 230, 232, 233, 236, 290, 299, 314, 334, 335
sign bit, 12
signal, 11
simplicity, 213
simulation, 119, 121, 265, 270, 330, 393, 418
single-quote character, 14, 165, 224
singleton, 126
skill, 333
SkillShareApp class, 386
skill-sharing project, 371–373, 375, 381
slash character, 13, 35–36, 146, 156, 315, 364, 425
slice method, 72, 73, 88, 233, 409, 416
slope, 424
sloppy programming, 261
smooth animation, 241
SMTP, 220
social factors, 349
some method, 92, 95, 191, 376, 426
sorting, 229
source property, 158
special return value, 134, 135
specialForms object, 208
specificity, 239
SpiderMonkey, 400
spread operator, 274
spy, 256
square, 28
square brackets, 60, 61, 74, 76, 107, 147, 324, 328, 409
stack, see call stack stack overflow, 47, 50, 56, 408
stack trace, 136
staged compilation, 392
standard, 5, 26, 35, 88, 136, 162, 349, 354, 355
standard environment, 26
star, 307, 420 Star Trek insignia, 292
startPixelEditor function, 347
startState constant, 347
startsWith method, 364
stat function, 359, 365, 366, 425
state
of application, 275, 334, 342, 346, 347, 388
in binding, 24, 31, 32, 34, 400
in iterator, 197
statement, 23, 24, 28, 31, 32, 42, 63
static (reserved word), 26
static method, 110, 113, 268, 413
static typing, 403
Stats type, 366
statSync function, 425
stopPropagation method, 250
storage function, 187
stream, 220, 361–363, 364, 367, 378
strict mode, 130
notation, 14
properties, 72
representation, 15
searching, 73
strokeStyle property, 290
strokeText method, 295
structure, 168, 222, 227, 334 Structure and Interpretation of Computer Programs, 202
structure sharing, 79
style, 237
style sheet, see CSS subclass, 111
substitution, 54
summing example, 4, 83, 89, 211
superclass, 111
survey, 294
Sussman, Gerald, 202
swapping bindings, 424
swipe, 342
switch keyword, 34
symbiotic relationship, 183
symbol, 106
Symbol function, 106
Symbol.iterator symbol, 107
SymmetricMatrix class, 111
synchronous programming, 182, 195, 359, 368
syncState method, 335, 338, 340, 341, 349, 426
syntax
expression, 23
identifier, 26
object, 63
operator, 13
string, 14
syntax tree, 204–205, 207, 228–229
SyntaxError type, 206
TAB key, 320
tabbed interface (exercise), 262, 419
tabindex attribute, 252, 320, 349
table (HTML tag), 243, 266, 274, 422
table example, 417
tableFor function, 68
tags, 221–222, 227, 239, see also names of specific tags
talkResponse method, 380
talksAbout function, 231
talkURL function, 383
Tamil, 87
tampering, 317
tangent, 75
target property, 250
task management example, 71
Tef, 166
temperature example, 110
template literals, 15
tentacle (analogy), 25, 63, 65
terminal, 354
termite, 183
test method, 146
test runners, 132
test suites, 132
text, 14, 221, 222, 227, 229, 295, 305–307, 322, 324, 358, 422
text field, 257, 318, 319, 322
text method, 315
text wrapping, 305
text-align (CSS), 243
textarea (HTML tag), 260, 318, 322, 327, 330, 425
textBaseline property, 295, 420
textContent property, 418, 422
th (HTML tag), 243
then method, 186–188, 191, 416
theory, 133
this binding, 62, 98–99, 101, 130
throw keyword, 135, 136, 139, 141, 413
tile, 303
time, 147, 148, 150, 184, 241, 261, 277, 278, 280, 283, 303, 346
time zone, 150
timeline, 182, 197, 223, 241, 247, 258
timeout, 188, 259, 373, 374, 380
Timeout class, 189
times method, 269
timing, 396
title, 382
toDataURL method, 344
tool, 145, 164, 175, 334, 339, 340, 342–344, 347, 350, 357
tool property, 335
ToolSelect class, 340
top-level scope, see global scope
toString method, 99, 100, 103–105, 346, 362
touchend event, 255
touches method, 278
touchmove event, 255, 339, 350
touchstart event, 255, 337, 339
toUpperCase method, 62, 132, 243, 362
transform (CSS), 287
transformation, 297–299, 308, 420
Transmission Control Protocol, 220, 221, 311, 373
transpilation, 213
traversal, 152
treeGraph function, 394
trial and error, 133, 282, 293
true, 16
trust, 224
try keyword, 136, 137, 190, 413, 422
type observation, 392, 401, 403
type variable, 131
typing, 260
typo, 129
Ullman, Ellen, xx
undefined, 18, 19, 25, 42, 47, 61, 63, 77, 129, 130, 134
underline, 237
underscore character, 26, 35, 98, 151, 157
UndoButton class, 347
Unicode, 15, 17, 87, 92, 147, 162, 163
unicycling, 371
Uniform Resource Locator, see URL uniformity, 204
uniqueness, 239
Unix time, 150
unshift method, 71
unwinding the stack, 135
upcasing server example, 362
updateState function, 336
upgrading, 169
upload, 325
URL, 221, 224, 288, 313, 315, 317, 360, 373, 383
URL encoding, 314
urlToPath function, 364
usability, 251
use strict, 130
user experience, 247, 320, 372, 383
users’ group, 371
V8, 398
validation, 134, 140, 203, 277, 321, 378, 379
value attribute, 318, 322, 324
variables, see also binding
Vec class, 113, 268, 269, 280, 394, 396, 421
vector graphics, 295
version, 169, 222, 312, 357, 398
viewport, 275–277, 301, 302, 305
VillageState class, 119
virtual keyboard, 252
virus, 224
void operator, 26
volatile data storage, 12
waitForChanges method, 380
waiting, 184
walking, 303
warning, 357
web, see World Wide Web
web browser, see browser
web page, 174
web worker, 259
WebDAV, 369
webgl (canvas context), 289
website, 224, 225, 313, 353, 369, 371
WebSockets, 373
weekend project, 369
weresquirrel example, 60, 62, 64, 66, 69, 71
while loop, 4, 30, 32, 53, 160
whitespace
indentation, 32
Why’s (Poignant) Guide to Ruby, 22
window object, 248
with statement, 131
word boundary, 151
workbench (exercise), 330, 422
world, of a game, 265
World Wide Web, 5, 77, 219, 221, 224, 225, 311
writeFile function, 359, 361, 425
writeHead method, 360
writing system, 87
WWW, see World Wide Web
XML namespace, 288
xmlns attribute, 288
yield (reserved word), 26
yield keyword, 197
your own loop (example), 95
Zawinski, Jamie, 144
zero-based counting, 56, 61, 150
zeroPad function, 54
zigzag shape, 420
zooming, 305
18.116.37.62