Implement inSequence(tasks) to execute promise-returning functions sequentially

Tests async/await control flow versus Promise.all parallelism. A strong answer uses a for-of loop with await inside an async function, accumulates results in order, and stops cleanly on rejection. Red flag: suggesting Promise.all or forEach with await.
Tests deep understanding of JavaScript event loop and sequential async orchestration. A great answer implements an async function with a standard for or for-of loop, awaiting each task call, pushing results into a pre-allocated or dynamic array, and letting native async semantics propagate the first rejection immediately. It explicitly contrasts this with Promise.all, which runs concurrently.
Read the original → developer.mozilla.org
- #async-await
- #promises
- #typescript
- #sequential-execution
- #interview
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.