xboxremote (6) [Avatar] Offline
#1
On Listings 4.8 and 4.9, it talks about exporting an "addTwo" function that takes a number and adds two to it. In Listing 4.9, the code passes the number 4 as an argument to the function, but the comment immediately after says it returns 4. It should return 6:

4.8 (basic-math.js):

exports.addTwo = n => n+2;


4.9:

const basicMath = require('./basic-math');

basicMath.addTwo(4); // returns 4


4.9 should be:

const basicMath = require('./basic-math');

basicMath.addTwo(4); // returns 6
Steve Kinney (27) [Avatar] Offline
#2
Thank you so, so much! You're totally right. I've fixed this in the manuscript.
xboxremote (6) [Avatar] Offline
#3
Steve Kinney wrote:Thank you so, so much! You're totally right. I've fixed this in the manuscript.


No worries!

- Nick