Skip to content

Instantly share code, notes, and snippets.

@Nalini1998
Nalini1998 / Chaining Multiple Promises
Last active April 19, 2023 21:18
JAVASCRIPT PROMISES: One common pattern we’ll see with asynchronous programming is multiple operations which depend on each other to execute or that must be executed in a certain order. We might make one request to a database and use the data returned to us to make another request and so on! Let’s illustrate this with another cleaning example, w…
Chaining Multiple Promises
firstPromiseFunction()
.then((firstResolveVal) => {
return secondPromiseFunction(firstResolveVal);
})
.then((secondResolveVal) => {
console.log(secondResolveVal);
});
--------------------