DEV Community

Discussion on: for loop vs .map() for making multiple API calls

Collapse
 
askrishnapravin profile image
Krishna Pravin

This approach looks good. Pushing the promises into an array within for loop will achieve concurrency.
But when we have a need for more than one await inside the block, it will not work.
In the above code, response.json() won't work because response is a promise, it won't have json() method.