Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
For the example of mathPromise, why .then(addFive) and not .then(addfive(value))
for this part:
const value = 5; mathPromise .then(addFive) .then(double) .then(finalValue) .catch( err => console.log(err) )
How are we calling the functions inside the methods without including the parameter value?
Steven Parker229,005 Points
Just naming the function doesn't call it, it passes it to the handler which will call it later when the "then" condition is satisfied. At that time, it will be passed the value which the "then" is waiting for.
It wouldn't make sense to call it right now since the value needed to pass to it isn't available yet.