Executes an array of asynchronous tasks sequentially (one after another), returning an array of results in the same order as the tasks.
Unlike parallelLimit, tasks are not run concurrently.
parallelLimit
The type of each task’s resolved value.
An array of functions returning promises.
A promise that resolves to an array of task results.
const tasks = [ async () => 1, async () => 2, async () => 3];const results = await series(tasks);console.log(results); // [1, 2, 3] Copy
const tasks = [ async () => 1, async () => 2, async () => 3];const results = await series(tasks);console.log(results); // [1, 2, 3]
1.1.0
Executes an array of asynchronous tasks sequentially (one after another), returning an array of results in the same order as the tasks.
Unlike
parallelLimit
, tasks are not run concurrently.