Susan Harkins (398) [Avatar] Offline
#1
Please post errors found in the published version of Get Programming with JavaScript Next here. If necessary, we'll publish a comprehensive list for everyone's convenience. Thank you!

Susan Harkins
Errata Editor
Manning Publications
MickeyP (23) [Avatar] Offline
#2
Lesson 27.5: Declaring Class Instance Properties, Example fails in ES6 needs ES7
The example given on page 272 is incorrect. The code on line 5 is not correct. The instance property must be defined inside of a class method.

class DataStore {
    fetch() {
        ajax(this.url, this.handleNewrecords)
    }
    handleNewRecords = (records) => {
        // do something more complex like
        // merging new records in with existing records
    }
}


From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes Instance properties must be defined inside of class methods

***** Update *****

The issue is that when trying it out I was using a repl and Babel currently won't understand this syntax (assuming the ES2015 preset)

I've since looked at a number of React Components that I've defined where I've actually been using this approach extensively for declaring class properties. Babel has a transform plugin to allow this syntax.

babel-plugin-transform-class-properties

This allows this syntax which is stage-2 of ES7 to work.

further info http://borgs.cybrilla.com/tils/es7-class-properties/
MickeyP (23) [Avatar] Offline
#3
QC 28.1 Answer incorrect
Hi, the answer in QC 28.1 is not correct. It is missing Animal in the inheritance chain

It should be

instance -> Humpback -> Whale -> Animal -> Object -> null
MickeyP (23) [Avatar] Offline
#4
QC 31.1 Answer is not correct
QC 31.1 In the answer the Promise constructor is given two separate functions of resolve and reject .

new Promise (res, rej) {...}

The Promise constructors needs a single function param which takes the res, rej parameters.

So it needs to be new Promise(function(res, rej){....})
jfs.world (116) [Avatar] Offline
#5
QC 31.1 Answer is not correct
MickeyP wrote:QC 31.1 In the answer the Promise constructor is given two separate functions of resolve and reject .

new Promise (res, rej) {...}

The Promise constructors needs a single function param which takes the res, rej parameters.

So it needs to be new Promise(function(res, rej){....})


good catch! I think what was meant was
new Promise((res, rej) => {

(continuing with the convention of using arrow functions)
jfs.world (116) [Avatar] Offline
#6
QC 31.2 does not seem right. When comparing the question, vs the answer, either the question is wrong (the line
calculateRoute(destination => {
needs to be removed) or the answer is wrong, and needs to consider the 'calculateRoute' function call.
jfs.world (116) [Avatar] Offline
#7
The last line of code before "QC 31.3 answer" on page 315 should have the callback function parameters as "(error, comments)", rather than "(error, author)". After all, this is the callback function to loading the comments!