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 trialchelseacheevers
13,786 PointsComplete the code by writing the method that gets the resolved value out of the promise returned by dataPromise.
Hey everyone,
This is a quiz question that I cannot find the answer to anywhere on the web not even MDN or Stack Overflow. Based on what's out there, I would have assumed the blank field would be "resolve", but I get an error saying this is incorrect. I am not really sure what I am supposed to be doing...
"Complete the code by writing the method that gets the resolved value out of the promise returned by dataPromise."
dataPromise
. ______ (data => console.log(data))
1 Answer
Torben Korb
Front End Web Development Techdegree Graduate 91,433 PointsHi Chelsea,
it means the then()
method, which is available at Promise.prototype.then
and allows to proceed further actions on a settled promise .
See here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises and here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then
Hope this helps! Happy coding!