Errata
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted By | Date submitted | Date corrected |
---|---|---|---|---|---|
Printed, PDF, ePub | Page 17 Chart at top of page |
The line exiting && should curve up. |
Douglas Crockford |
Feb 25, 2013 | |
Other Digital Version | many downloadable code examples |
I would like to echo Rob Anderson's comment. The online example code is wrong in numerous places. One of the most egregious examples is the "Bad Example"/"Better Example" example on page 38/39. |
Anonymous | Aug 09, 2012 | Aug 14, 2012 |
Other Digital Version | 1 Code Samples |
The code samples provided at the following address contain numerous errors: |
Rob Anderson | Jul 14, 2012 | Aug 14, 2012 |
Printed | Page 150, others See description |
The method() method is used in 15 or more places in the book, but the index lists it only once, and fails to list either of the places where method() is defined and explained. Without that, the implication is that it's a built-in JS function... unless one happens to have read the book in order, and remembered where it was defined. Note from the Author or Editor: |
gwideman | Mar 29, 2012 | |
Printed, PDF, , Other Digital Version | Page Section B.7 Code sample |
In section B.7, the C code: Note from the Author or Editor: |
Niklas Schm?cker | Feb 19, 2012 | |
Printed | Page 81 Function by |
Where an object is thrown inside the else clause of the function by, the value of the message property ends with an erroneous semicolon ? this should be omitted. Note from the Author or Editor: |
Thomas Ingram | Nov 25, 2011 | |
Printed | Page 123 Bottom of page |
Delete |
Douglas Crockford |
Aug 03, 2011 | Aug 26, 2011 |
Printed | Page 122 ++ and -- |
In the last line of the paragraph, replace |
Douglas Crockford |
Aug 03, 2011 | Aug 26, 2011 |
Printed | Page 122 Top of page |
Replace the second sentence with |
Douglas Crockford |
Aug 03, 2011 | |
Printed | Page 121 = |
Delete |
Douglas Crockford |
Aug 03, 2011 | Aug 26, 2011 |
Page 118 Top of page |
/*members |
Douglas Crockford |
Aug 03, 2011 | ||
Printed | Page 117 Bottom of page |
Replace Table C-1 with the table from http://www.jslint.com/lint.html#options |
Douglas Crockford |
Aug 03, 2011 | |
Printed | Page 43 Last line of first example |
tip('This box is resizeable.'); |
Douglas Crockford |
Aug 03, 2011 | Aug 26, 2011 |
Printed | Page 18 object literal train track |
According to the diagram, the first part of an object literal can be a name or a string. However, string is never defined. Do you mean string literal, or are there other types of strings allowed. Note from the Author or Editor: |
rrs | Apr 08, 2011 | |
Other Digital Version | xiii Downloadable code |
Not only are the typo's not fixed here, whereas the are the printed version of the book. Note from the Author or Editor: |
Frank Sjoukes | Apr 07, 2011 | |
Printed | Page 29 Last line of first code listing |
For consistency with the previous code listing, it would make sense to put the expected output of Note from the Author or Editor: |
Duncan Parkes | Mar 17, 2011 | Aug 26, 2011 |
Printed | Page 16 Errata |
This is not really an error with the book, but an error in the errata. Note from the Author or Editor: |
Anonymous | Mar 16, 2011 | |
Printed | Page 17 infix operator diagram |
In the infix operator diagram, to the right of the 'logical and' oval, the line meets the vertical line at a right angle. It should be curved upwards to indicate that this branch goes to the end of the diagram. Note from the Author or Editor: |
Duncan Parkes | Mar 16, 2011 | |
Printed | Page 129 literal (bottom) |
The box that says [ function ] should say [ function literal ] . |
Douglas Crockford |
Dec 20, 2010 | |
Printed | Page 106 Middle of page |
Replace: |
Anonymous | Nov 04, 2010 | Nov 01, 2010 |
Printed | Page 106 In the second code fragment |
Replace |
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 37 In the code sample in the middle of the page |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 118 Bottom of the page |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 140 The end of the third paragraph |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 106 Second code fragment |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 113 Last line on page (code) |
It should be: |
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 113 Last paragraph/last line |
Replace |
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 109 The quote at the top of the page |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 79 The [this.length, 0] statement |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 71 The var my_regexp statement in the middle of the page |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 55 Statement at the bottom of the page |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 49 The return statement |
|
Anonymous | Nov 03, 2010 | Nov 01, 2010 |
Printed | Page 42-43 The code example at the bottom |
The line breaking style is wrong. Lines should be broken before '.' and not after. So move every '.' at the end of a line to the next line. So |
Douglas Crockford |
Oct 25, 2010 | Nov 01, 2010 |
Printed | Page 37 9th line from bottom of page |
In the last line of the 2nd-to-last paragraph, it reads, "... and those methods continue to enjoy the privilege of access to the value variable." |
Patrick Webster | Aug 05, 2010 | Nov 01, 2010 |
Page 25 "string literal" railroad diagram |
You can't make a string like "\n" using the "string literal" railroad diagram Note from the Author or Editor: |
fmaste | Jun 02, 2010 | ||
Printed | Page 21 Retrieval |
Under the Retrieval section: Note from the Author or Editor: |
kovacs | Mar 25, 2010 | Nov 01, 2010 |
Printed | Page 12 2nd para, last sentence (under `switch' diagram) |
`default' should be in code font since it is a reserved word just as `switch' was in the first sentence of this same paragraph, i.e.: |
kovacs | Mar 25, 2010 | Nov 01, 2010 |
Printed | Page 9, 134 top diagram on both pages |
Both string literal syntax diagrams incorrectly forbid an escaped character immediately before the closing quote. This is immedately contradicted by "\u0041" in the first example on page 9, May 2008 First Edition bought at Borders. Note from the Author or Editor: |
Devon Sean McCullough | Jan 17, 2010 | |
Printed | Page 39 first and second code examples |
The lines of the introductory comments in both code examples on this page are too long for the printed version. The resulting line breaks cause invalid syntax due to the use of end-of-line comments. |
yacht | Nov 18, 2009 | Apr 01, 2010 |
Printed | Page 18 first figure |
Literal can be one of six literals. |
Anonymous | Oct 08, 2009 | Apr 01, 2010 |
Printed | Page 101 First line of text |
(First prinitng, May 2008) |
Robert Hughes | Sep 13, 2009 | Apr 01, 2010 |
Printed | Page 88 After the second line of code at the top of the page |
(This error is in the first printing, May 2008.) |
Robert Hughes | Sep 13, 2009 | Apr 01, 2010 |
Printed | Page 86 Fifth line of code from the foot |
(This error is in the first printing, May 2008.) |
Robert Hughes | Sep 13, 2009 | Apr 01, 2010 |
Printed | Page 83 Main code example, six lines from the end |
(I have the first printing, May 2008) |
Robert Hughes | Sep 12, 2009 | Nov 01, 2010 |
Printed | Page 91 1st code block under string.split(separator, limit) |
The text says: Note from the Author or Editor: |
Micah Stetson | Jul 09, 2009 | Apr 01, 2010 |
Printed | Page 50 In the second example |
Add "middle: m," on the line after "last: l,". |
Douglas Crockford |
May 25, 2009 | Apr 01, 2010 |
Printed | Page 16 in Table 2-1 replace "modulo" with "remainder" |
Also make this replacement in the diagram called "infix operator" on page 17 and page 129. Note from the Author or Editor: |
Douglas Crockford |
May 22, 2009 | Apr 01, 2010 |
Printed | Page 89 2nd paragraph |
replace "localCompare" with "localeCompare" |
Douglas Crockford |
May 19, 2009 | Apr 01, 2010 |
Printed | Page 68 2/3rds down, paragraph that starts with Note |
Replace "want we want" with "what we want". |
Douglas Crockford |
May 18, 2009 | Apr 01, 2010 |
Printed | Page 39 // BETTER EXAMPLE |
The "BETTER EXAMPLE" is broken. The fix to the first printing was still incorrect. The example should read Note from the Author or Editor: |
Anonymous | Apr 09, 2009 | Apr 01, 2010 |
Printed | Page 42 Code at top of page, third to last line |
|
Anonymous | Apr 03, 2009 | Apr 01, 2009 |
Printed | Page 117 Table C-1 |
Table C-1 does not jive with Options listed at http://www.jslint.com/#options ( and the JSLint Options listed at http://www.jslint.com/lint.html ) -- the latter has more options than Table C-1 Note from the Author or Editor: |
kovacs | Mar 09, 2009 | Apr 01, 2009 |
Printed | Page 74 middle |
The edition of the book I have has a single character instead of the required `\u' for each of the four separate UniCode hex enumerations in the regular expression. This single character resembles a crescent moon and may be (or: is similar to) \u02D8. Note from the Author or Editor: |
Anonymous | Mar 07, 2009 | Apr 01, 2009 |
Printed | Page 33 Code near bottom of page |
On page 33, the code at the top of the page includes `return this;' while the similar code at the bottom of the page is missing this statement. |
Anonymous | Mar 07, 2009 | Apr 01, 2009 |
Printed | Page 10 last sentence |
In the last sentence of page 10, the word "then" should not be set in a constant width font since it is not a keyword; it should be italicized (like "truthy" in the same sentence was). |
Anonymous | Mar 06, 2009 | Apr 01, 2009 |
Printed | Page 41 first code sample (continued from page 40) |
The syntax at the end of the sample is incorrect. It should end with: |
Neal Tucker | Feb 24, 2009 | Apr 01, 2009 |
Printed | Page 134 After diagram for throw statement |
In the first printing of the book (May 2008), the diagram for the try statement is missing from Appendix D. Note from the Author or Editor: |
Anonymous | Dec 29, 2008 | Apr 01, 2009 |
Printed | Page 42 3rd line from bottom in code example on top of page |
This line: |
Craig Doremus | Dec 29, 2008 | Nov 01, 2008 |
Printed | Page 140 last section of code |
Missing commas - replace last section with: |
Anonymous | Nov 21, 2008 | Apr 01, 2009 |
Printed | Page 71 line with new RegExp |
the following: |
Anonymous | Oct 24, 2008 | Nov 01, 2008 |
54 second code block |
This error is in the Print version and the Safari Online version. On Page 54, the second code block where the function "cat" is defined, the get_name method does not have a closing parenthesis. Note from the Author or Editor: |
Anonymous | Oct 22, 2008 | Nov 01, 2008 | |
4.12. Module 3rd code example |
Hello, |
Anonymous | Oct 21, 2008 | Nov 01, 2008 | |
Printed | Page 41 the last line of the deentityfy function example |
The last line of the example reads: |
Anonymous | Oct 19, 2008 | Nov 01, 2008 |
Printed | Page 29 end of first code example |
The last line of code uses a getter: |
Anonymous | Oct 18, 2008 | Nov 01, 2008 |
Printed | Page 29 last line of the first code example [9/08] |
the last line of the code example reads: |
Anonymous | Oct 16, 2008 | Nov 01, 2008 |
4.12 last code block |
This line |
Anonymous | Oct 14, 2008 | Nov 01, 2008 | |
Printed | Page 60 Last paragraph of "Delete" section |
The book reads: "The property whose value is 'shi' has its key changed from '4' to '3'." |
Anonymous | Oct 12, 2008 | Nov 01, 2008 |
Printed | Page 42 middle of the page |
seqer.set_prefix('Q';) |
Douglas Crockford |
Oct 11, 2008 | Nov 01, 2008 |
Printed | Page 42 code example on the top |
There are two errors in this code example: |
Anonymous | Oct 10, 2008 | Nov 01, 2008 |
Printed | Page 33 2nd Example: 'integer' method |
Typo: Replace 'ceiling' by 'ceil': |
Anonymous | Oct 09, 2008 | Nov 01, 2008 |
Printed | Page 54 code example "var cat" |
Missing Note from the Author or Editor: |
Anonymous | Oct 04, 2008 | Nov 01, 2008 |
Printed | Page 21 First code sample under heading "Retrival" |
The code reads: Note from the Author or Editor: |
Anonymous | Oct 02, 2008 | Nov 01, 2008 |
Printed | Page 54 In code in the middle of the page |
The "that.get_name" method needs a closing curly bracket to end the function before the "return that;" statement. |
Anonymous | Oct 01, 2008 | Nov 01, 2008 |
Printed | Page 136 4th line |
shoulddwell => should dwell |
Douglas Crockford |
Sep 24, 2008 | Nov 01, 2008 |
Printed | Page 90 3rd paragraph, string.replace sample for replacing an old phone area code |
Hi, |
Anonymous | Aug 19, 2008 | Nov 01, 2008 |
Printed | Page 33 Second code example |
In the function it is tried to invoke the method 'ceiling' on Math which will fail because the method is named 'ceil'. |
Anonymous | Aug 12, 2008 | Nov 01, 2008 |
Printed | Page 39 supposed corrected better example at 9780596517748.confirmed |
from 9780596517748.confirmed Note from the Author or Editor: |
Anonymous | Jul 25, 2008 | Sep 01, 2008 |
Printed | Page 59 first paragraph, lines 8 and 12 (see line 2) |
The name of an object is missing a letter Note from the Author or Editor: |
Anonymous | Jul 15, 2008 | Sep 01, 2008 |
Printed | Page 59 1st paragraph |
The original text follows: |
Anonymous | Jul 15, 2008 | Sep 01, 2008 |
Printed | Page 74 3rd paragraph, regular expression example |
The regular expression given in the example: |
Anonymous | Jul 07, 2008 | Sep 01, 2008 |
Printed | Page 136 middle |
JSON has six kinds of values: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 134 middle |
Delete the first while diagram. Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 122 ++ and -- |
replace |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 105 Last code example |
Replace |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 88 string.charAt(pos) |
Replace |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 47 second code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 42 First code example |
replace |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 37 Second paragraph |
Replace getElementsByClassName with getElementsByAttribute |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 64 second code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 63 second code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 52 last line of code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 39 First code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 37 First code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 34 First code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 32 first code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 29 First code example |
Replace Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 28 First code example |
value: 0; Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 24 second code example |
The last two lines of the example are |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 13 in the code sample |
hasownProperty should be hasOwnProperty |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 10 Last paragraph, first sentence |
'based in' should be 'based on'. |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page xiii Acknowledgments |
LeComte should be Lecompte (no camelCase). Note from the Author or Editor: |
Douglas Crockford |
Jun 30, 2008 | Sep 01, 2008 |
Printed | Page 39 BETTER EXAMPLE portion of code |
var add_the_handlers = function (nodes) { Note from the Author or Editor: |
Anonymous | Jun 21, 2008 | Sep 01, 2008 |
Printed | Page 69 Bottom footnote |
In the press them all together regex, there's an extra ? (between the ) and ( ) Note from the Author or Editor: |
Anonymous | Jun 10, 2008 | Sep 01, 2008 |
Printed | Page 42 code example |
The variable should hold the function value, not the object returned by a call to the function. Instead of: |
Anonymous | Jun 07, 2008 | Sep 01, 2008 |
Printed | Page 32 last line of the second example |
tryIt should be try_it |
Anonymous | Jun 06, 2008 | Sep 01, 2008 |
Printed | Page 51 first code example |
return this.says + ' ' + this.name + ' ' + this.says; |
Anonymous | Jun 04, 2008 | Sep 01, 2008 |
Printed | Page 47 4th line of code in middle of page |
The code listing on page 47 of Crockford's book Javascript - The Good Parts is missing a semicolon, namely: |
Anonymous | Jun 03, 2008 | Sep 01, 2008 |
Printed | Page 41-42 code example beginning on page 41 and continuing on 42 |
code example should read: |
Anonymous | Jun 03, 2008 | Sep 01, 2008 |
Printed | Page Section 4.6 second block of code |
the function declaration is named try_it, but it then tries to call the function by tryIt(). |
Anonymous | Jun 02, 2008 | Sep 01, 2008 |
Printed | Page 64 Code block after 1st paragraph |
From the context, it seems this part: |
Anonymous | Jun 02, 2008 | Sep 01, 2008 |
Printed | Page 42 End of first code block, the definition of serial_maker |
The serial_maker function should not be invoked when it is defined. Invoking it as shown in the book sets serial_maker to reference an object with 3 methods. The subsequent statement: Note from the Author or Editor: |
Anonymous | May 27, 2008 | Sep 01, 2008 |
Printed | Page 32 2nd code sample |
The last line of the code sample should reads: |
Anonymous | May 26, 2008 | Sep 01, 2008 |
Printed | Page 98 next to last line |
'firortranst' should be 'first' |
Douglas Crockford |
May 15, 2008 | Sep 01, 2008 |
Printed | Page xiii |
Location: Acknowledgments |
Anonymous | Sep 01, 2008 | |
Printed | Page 10 |
Location: Last paragraph, first sentence |
Anonymous | Sep 01, 2008 | |
Printed | Page 13 |
Location: in the code sample |
Anonymous | Sep 01, 2008 | |
Printed | Page 22 |
Location: under Prototype, second paragraph, third line and in code below it |
Anonymous | Sep 01, 2008 | |
Printed | Page 23 |
Location: second code line at the top of page |
Anonymous | Sep 01, 2008 | |
Printed | Page 24 |
Location: second code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 28 |
Location: First code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 29 |
Location: First code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 32 |
Location: first code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 32 |
Location: 2nd code sample |
Anonymous | Sep 01, 2008 | |
Printed | Page 34 |
Location: First code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 37 |
Location: First code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 37 |
Location: Second paragraph |
Anonymous | Sep 01, 2008 | |
Printed | Page 39 |
Location: First code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 39 |
Location: BETTER EXAMPLE portion of code |
Anonymous | Sep 01, 2008 | |
Printed | Page 41-42 |
Location: code example beginning on page 41 and continuing on 42 |
Anonymous | Sep 01, 2008 | |
Printed | Page 42 |
Location: code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 42 |
Location: First code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 42 |
Location: End of first code block, the definition of serial_maker |
Anonymous | Sep 01, 2008 | |
Printed | Page 47 |
Location: second code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 47 |
Location: 4th line of code in middle of page |
Anonymous | Sep 01, 2008 | |
Printed | Page 51 |
Location: first code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 51 |
Description: second line, first line of code, 10th line of code from the bottom, |
Anonymous | Sep 01, 2008 | |
Printed | Page 52 |
Location: last line of code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 52 |
Description: 14th line from top |
Anonymous | Sep 01, 2008 | |
Printed | Page 53 |
Description: 12th line from top |
Anonymous | Sep 01, 2008 | |
Printed | Page 59 |
First paragraph, lines 8 and 12 (see line 2) |
Anonymous | Sep 01, 2008 | |
Printed | Page 63 |
Location: second code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 63 |
Description: 9th line from top |
Anonymous | Sep 01, 2008 | |
Printed | Page 64 |
Location: second code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 64 |
Location: Code block after 1st paragraph |
Anonymous | Sep 01, 2008 | |
Printed | Page 69 |
Location: Bottom footnote |
Anonymous | Sep 01, 2008 | |
Printed | Page 74 |
3rd paragraph, regular expression example |
Anonymous | Sep 01, 2008 | |
Printed | Page 86 |
Description: under Object, second line of code |
Anonymous | Sep 01, 2008 | |
Printed | Page 88 |
Location: string.charAt(pos) |
Anonymous | Sep 01, 2008 | |
Printed | Page 98 |
Location: next to last line |
Anonymous | Sep 01, 2008 | |
Printed | Page 105 |
Location: Last code example |
Anonymous | Sep 01, 2008 | |
Printed | Page 122 |
Location: ++ and -- |
Anonymous | Sep 01, 2008 | |
Printed | Page 134 |
Location: middle |
Anonymous | Sep 01, 2008 | |
Printed | Page 136 |
Location: middle |
Anonymous | Sep 01, 2008 | |
Printed | Page 147 |
Description: under arrays |
Anonymous | Sep 01, 2008 | |
Printed | Page 151 |
Description: Object.beget method changed to Object.create method |
Anonymous | Sep 01, 2008 |