Suppose I have three different promises each taking a varying amount of time to resolve - 1000ms, 2000ms, and 3000ms respectively.
How can I simultaneously start all the promises and handle them as they get resolved?
For instance:
let quickPromise = new Promise((resolve, reject) => {
setTimeout(() => resolve(""), 1000);
});
let normalPromise = new Promise((resolve, reject) => {
setTimeout(() => resolve(""), 2000);
});
let slowPromise = new Ppromise((resolve, reject) => {
setTimeout(() => resolve(""), 4000);
});
In such a scenario, the goal would be to initiate all three promises simultaneously and manage their resolution sequentially - starting with the quickPromise, followed by the normalPromise, and lastly the slowPromise.