Calling this an oopsie or an error is a bit unfortunate.
Sometimes you want to make requests serially. This is not a mistake.
Maybe you want to fail or interrupt the whole process based on the result of one of the fetches. You can do that easily in a for loop.
Consider if you had 100 fetches to do - you don't want to fire them all off simultaneously and flood the services you're using. You could take serial chunks of the work in a for loop and fire those off in parallel.
So, good tip with map & Promise.all, but serial execution is not a mistake in and of itself
Thank you for this comment. I should have stated that this is only something people should be aware of. I went with a clickbaity title just to get it out there. I'll update the article to include this.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Calling this an oopsie or an error is a bit unfortunate.
Sometimes you want to make requests serially. This is not a mistake.
Maybe you want to fail or interrupt the whole process based on the result of one of the fetches. You can do that easily in a for loop.
Consider if you had 100 fetches to do - you don't want to fire them all off simultaneously and flood the services you're using. You could take serial chunks of the work in a for loop and fire those off in parallel.
So, good tip with map & Promise.all, but serial execution is not a mistake in and of itself
Thank you for this comment. I should have stated that this is only something people should be aware of. I went with a clickbaity title just to get it out there. I'll update the article to include this.