Errata
Eloquent JavaScript, 3rd Edition

These are the known mistakes in the third edition of the book. For errata in the first edition, see this page. For the second edition, see this page. To report a problem that is not listed here, send me an email.

Issues whose page number is followed by an ordinal number are only present up to the print denoted by that number. I.e. those followed by “1st” were fixed in the second print.

Chapter 2

Page 34 (1st) Updating Bindings Succintly: Where it says counter- it should be counter--.

Chapter 5

Page 91 Composability: Due to an initial mistake in the script data set, the results of the computations on this page differ from the ones with the current, corrected data. The average year for living scripts should be 1165, the average for non-living scripts should be 204.

Chapter 6

Page 111 (2nd) Inheritance: In the second paragraph below the example code, instead of “content method”, the text should say “element function”.

Chapter 8

Page 134 (2nd) Error Propagation: In the third paragraph of the section, a function promptInteger is referred to. The function is actually called promptNumber, and the word “whole” should be dropped from the sentence (it accepts non-whole numbers, too).

Chapter 10

Page 168 (1st) Modules as Building Blocks: In “each needs it own private scope“, it should say “its own private scope“.

Chapter 14

Page 234 (2nd) Creating Nodes: In the code, “edition” is misspelled as “editon”.

Chapter 15

Page 258 Load Event: The description of the beforeunload claims that you just need to return a string from your event handler. For handlers registered with addEventListener you, in fact, need to call preventDefault and set a returnValue property to get the warn-on-leave behavior.

Chapter 16

Page 285 (2nd) Pausing the Game: The text refers to the arrow binding, where it should say arrowKeys.

Chapter 20

Page 369 (1st) Directory Creation: MKCOL stands for “make collection”, not “make column” as the book claims.

Chapter 21

Page 373 HTTP Interface: There is a superfluous closing brace at the end of the example JSON snippet.

Exercise Hints

Page 414 A Modular Robot: The dijkstrajs package name is misspelled as dijkstajs.