Return Values in Promise Chains
Learn how promise chains return values.
Returning values in promise chains
Another important aspect of promise chains is their ability to pass data from one promise to the next. We have already seen that a value passed to the resolve()
handler inside an executor is passed to the fulfillment handler for that promise
. We can continue passing data along a chain by specifying a return value from the fulfillment handler.
Let’s look at the illustration below to see how this works.
Get hands-on with 1200+ tech skills courses.