Eloquent JavaScript: Errata

These are the known mistakes in the first print of the paper edition of Eloquent JavaScript. If you think you have found another one, please send me an email.

Chapter 1

Page 12: In the example 'You ain't never seen a donkey fly!', the quote in ain't should be escaped.

Page 17: "can be evoked" should say "can be invoked".

Page 21: Bottom paragraph, "writen" should be "written".

Page 24: In the paragraph above "Capitalization" header, an "s" is missing in "Then it start executing".

Page 27: In the top paragraph, NaN should also be listed as a value that is falsy.

Chapter 2

Page 35: In the code snippet that defines a power function, the first argument to the function should be base, not number.

Page 39: The part "all the operators that were performed" should be "all the operations...".

Chapter 3

Page 48: Third paragraph, "the value of which is a property" should say "the value of which it is a property".

Chapter 5

Pages 79, 81, 82, and 85: All instances of the word 'header' should say 'heading' instead.

Page 82: The second line of code snippet at the top of the page should be paragraphs.length (with an s), not paragraph.length.

Page 83: At the bottom of the page, the line that calls indexOrEnd has one too many closing parentheses at the end.

Page 87: At the very end of the page, there's a double quote missing at the end of the string " src=\"picture.png\" alt=\"The Picture\"".

Page 88: In the code fragment at the top, a semicolon is missing after the first return, though I claimed I'd write out all semicolons.

Page 89: In the renderFragment code snippet, the references to number should say fragment.number instead. Further down, the paragraph that starts "Rending a whole paragraph..." should say "Rendering a whole paragraph" instead.

Chapter 6

Page 106: Second paragraph, where it says "above and to the left", it should say "above and to the right".

Page 108: In the code snippet that introduces bind, as well as the text below that, any references to testArray should actually read x.

Page 109: In the definition of method, a return should be written before the expression in the inner function.

Page 110 and 116: In both definitions of processCreate, all references to creature should be replaced by creature.object, and all references to point with creature.point.

Page 117: In the code that defines creatureMove, the boolean operator in the if should be &&, not ||.

Page 120: In the code example, the inner loop variable should be j, not i.

Page 122: In the code snippet, the condition surroundings[this.direction] != "" should have && emptySpace.length > 0 appended to it.

Page 125: In the call to print at the bottom of the page, the comma and the dot before this.details should be switched (dot in quotes, comma after them).

Chapter 7

Page 131: First paragraph under "The Shape of a Module", "come up some techniques" should be "come up with some techniques".

Page 136: Third paragraph, first sentence, "return true" should be "returns true".

Chapter 8

Page 140: In the code example at the bottom of the page, the result of the search call should be 2, not 3.

Chapter 11

Page 181: In the code, the semicolon after boulders should be a colon.