June 2018
Beginner
288 pages
6h 31m
English
In the examples so far, promises were used to implement a single asynchronous task. In nontrivial scenarios, we may need multiple asynchronous tasks to be executed to solve a problem. For example, a currency exchange broker may want to pick the best price quote from more than one provider. A promise carries the response for a single asynchronous task, but when dealing with multiple tasks, we need to combine data from multiple asynchronous functions, each returning a promise.
JavaScript provides two options to deal with multiple asynchronous tasks:
Let’s explore each of these ...