|
|
|
|
|
by eurasiantiger
1734 days ago
|
|
After reading the comment again, isn’t the first example equal to: await Promise.all(
arr.map(item => item())
);
The async keyword is just syntactic sugar for immediately returning a Promise for whatever the function eventually returns, so the async-await inside the map is extraneous if item() is already async. |
|