This page lists unconfirmed errors and comments from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. JavaScript: The Good Parts, 1e by Douglas Crockford The catalog page for this title is http://www.oreilly.com/catalog/9780596517748/ This page was last updated August 1, 2008. If you have technical questions or error reports, you can send them to booktech@oreilly.com. Please specify the printing date of your copy or the digital version accessed. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem UNCONFIRMED errors and comments from readers: {13} Railroad diagram preceding last paragraph; The railroad diagram for the "try" statement is missing the "finally" clause and block. <33> The following code: Number.method('integer', function ( ) { return Math[this < 0 ? 'ceiling' : 'floor'](this); }); produces this error (in FF 2): Math[this < 0 ? "ceiling" : "floor"] is not a function {34}first code sample; From the May 2008 printing. Earlier in the book you pointed out that recursive functions should use the "function (..." form even if being assigned to a var. That was not done here. It might still work, as the recursive call in the function references the same var name the function is assigned to, but it's still not very good. You demonstrate the correct form in the next code sample on the next page (the "walk" function). [39]supposed corrected better example at http://oreilly.com/catalog/9780596517748/errata/9780596517748.confirmed; from http://oreilly.com/catalog/9780596517748/errata/9780596517748.confirmed var add_the_handlers = function (nodes) { var i; for(i = 0; i < nodes.length; i += 1) { nodes[i].onclick = function (i) { return function (e) { alert(e); }; }(i); } }; where this alert e and not i Notes from the Author: Replace alert(i) with alert(e) I thought the point of the example was to be able to display the ordinal value of the node. Instead it displays "[object MouseEvent]" for FireFox, "undefined" for IE (since no event passed with onclick property assignment). [44] Definition of 'curry' method at top of page; I believe that the two invocations of the slice method should be slice.apply(arguments,0) rather than slice.apply(arguments) Since the slice method has one mandatory argument (the starting index). {59}first paragraph, lines 8 and 12 (see line 2) ; The name of an object is missing a letter reads: number_object should be: numbers_object {61}first & second code sample; This might be considered more of an enhancement request as opposed to an error report. As described in the text, the first version of "is_array()" only works in the same window or frame. The second version rectifies that limitation, but is more complicated. Wouldn't the best solution be to combine the two solutions, where "value.constructor === Array" is ORed with the length, splice, and enumerable check ANDed together? Most uses would likely be in the same window or frame, so that should be optimized, putting the check for "Array" as the first condition in the OR. (67,68,69) bottom of 67, all of 68, top of 69; Starting after the line: "Let's factor parse_url into its parts to see how it works:", first the code is listed then the following paragraph describes it. However, there is a colon at the end of each paragraph which makes it very confusing as to which excerpt of code the paragraph is referring. Either the colons should be removed or each code excerpt should be moved after the paragraph describing it. The way it's written now, it would make more sense if the colons were just changed to periods instead. {74}3rd paragraph, regular expression example; The regular expression given in the example: var doubled_words = /[A-Za-z\u00C0-\u1FFF\u2800-\uFFFD'\-]+\s+\1/gi; does not include any capturing parens to allow the \1 backreference to work. I believe the corrected version should be: var doubled_words = /([A-Za-z\u00C0-\u1FFF\u2800-\uFFFD'\-]+)\s+\1/gi; [80]last code sample; I've stared and stared at the "work harder" version of "sort()", but I can't make head or tails out of the last return statement: return typeof a < typeof b ? -1 : 1; I would think this should just be converting both operands to strings and comparing them as strings. If I'm wrong, and this line is correct, the text should at least make it clear what it's doing here. {113} middle of page; This text: means about the same thing as: var foo = function foo() {}; should be: means about the same thing as: var foo = function () {}; without the extra "foo".