By Developers, For Developers
| PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
|---|---|---|---|---|---|
| 18 | TYPO | “To being” should be “To begin” | 2018-01-27 | ||
| 14 | TYPO | “pragrog.com” should probably be “pragporg.com” | 2018-01-27 | ||
| 22 | TYPO | In the TC39 box on the last line, it should read “or the Object spread” rather than “or they Object spread” | 2018-01-27 | ||
| 68 | SUGGEST | In setting up filters, filters2, and update, it seems that ‘const’ would be a better choice than ‘let’. Perhaps I am missing something? | 2018-04-04 | That's a tough one. `const` is a good choice because the value will not be reassigned. However, since it will be mutated, I like to alert code readers that the value will be changed that's why I went with `let`. To be honest, I still haven't decided which one I like better. I usually try to prevent the problem by not mutating objects (including map) and then I assign with `const`. Since I will be mutating these, I'll leave as `let`, but this is a decision each team needs to make. I think a lot of linters agree you should use `const`, though. | |
| 25 | TYPO | Last paragraph, 4th sentence: change “… you can rely instead OF the language feature to limit scope.” to “… rely instead ON the …”. Actually I prefer “… rely instead on language features …” since we are talking about let, const, modules, and I guess objects, too. | |||
| 26 | TYPO | “code is easier to reason” -> “code is easier to reason about” | |||
| 25 | TYPO | My apologies. The above typos for pages 25 and 26 were for a different book with a similar name. Please remove all these messages for me. | |||
| 33 | ERROR | The JavaScript method for adding an item to the beginning of an array is written as being `array.shift()`, when it is actually `array.unshift()`. The `array.shift()` method removes the first item at the beginning of an array. ``` | |||
| 15 | TYPO | In the second code block on the page, the call should be to function yell instead of greet: | |||
| 214 | TYPO | on 2nd paragraph line 4: | |||
| 194 | ERROR | In the second example from simple.js: (you should add parentheses) | |||
| 94 | TYPO | the 1st line of the 2nd paragraph from the bottom: | |||
| 71 | TYPO | The 1st line of the 2nd paragraph from the bottom: | |||
| 41 | TYPO | The 3rd line of the 2nd paragraph: You should omit one of “are” s | |||
| 80 | SUGGEST | The following statement strikes me as just a bit too stringent: “Though you can chain multiple ternary expressions together, you should avoid doing so.” Perhaps “you should avoid doing so” could be changed to “you should do so with care”. I think chained ternaries can remain clear and expressive if constructed carefully. For example, the book proposes the following cleaned-up code as preferable over the indeed puzzling nested ternary: if (title = 'manager') {
return ['time', 'overtimeAuthorization', 'pay'];
}
if (title = ‘supervisor’) { With some ample whitespace, this can be changed to a chained ternary which, in my eye, is readable and concise (well, when copy/pasted into a plain-text editor, at least): return title = 'manager' ? ['time', 'overtimeAuthorization', 'pay'] :
title = ‘supervisor’ ? [‘time’, ‘overtimeAuthorization’] : This structure reminds me of Clojure’s cond macro. All in all, I like the message that ternaries can quickly get out of hand but I don’t believe chained ternaries need be avoided at all times. | |||
| 80 | SUGGEST | Regarding #82416, my example code got mangled even more than I anticipated. Please see o10c7gda on jsfiddle for a formatted example. Thanks! | |||
| 46 | TYPO | you should update the output for: const anotherBook = { title: ‘Another book’, year: 2016, | |||
| 103 | SUGGEST | what the hell is a ’Colbert" regarding truthiness. consider your non-american readers. p | |||
| 36 | ERROR | In second sentence of second paragraph, change… “Turns out, sorting by name a second time…” … to… “Turns out, sorting by years a second time…” | |||
| 22 | TYPO | “affectively”[sic] should be “effectively” | |||
| 50 | SUGGEST | “Deciding when to use proposed syntax is a matter of preference.” You may wish to refer to the website caniuse.com where one can check the support of, say, spread operations. | |||
| 83 | SUGGEST | “So if one value in an || check returns true, you get that truthy value and not true.” | |||
| 86 | SUGGEST | Soon(?) you will be able to use the optional chaining operator (?.) and the nullish coalescing operator (??) for even more efficient short circuiting. | |||
| 90 | SUGGEST | const assignedFunction = function() { Finally! I’ve been holding my breath since Tip 3 in Chapter 1 for Joe to apply the benefits of block-scoping to function declarations and now that Tip is on the horizon — or is it an exercise left to the reader? | |||
| 50 | SUGGEST | another site for checking feature availability is | |||
| 144 | TYPO | ‘wvoquine’ on page 144 vs. ‘wvoquie’ on pages 145 and 146. might be a typo. | |||
| 218 | SUGGEST | Para. 5: “… but it isn’t accessible by JavaScript in the browser.” — please clarify. |