🔰await sequentially

JSasyncawaitpromises ⟩ sequentially

await multiple promises sequentially.

async function f() {
    // ⭐ awaiting multiple promises "sequentially"
    const a = await futureValue(20, 2);    // in 2 sec
    const b = await futureValue(30, 4);    // in 4 sec
    return a + b;
}
  • results

measureTime(f);        // ⭐ 6.00 sec : f() -> 50

Last updated