Looks like there are some duplicate candidates in the comments, but nonetheless here is a concise answer that provides several methods depending on the specific requirements:
You can use asyncjs' eachSeries
(if you want to use node-style callbacks) or bluebird's Promise.each
if using promises to fetch the URLs in series. If you don't need the fetching to happen in series, but they can all be fetched in parallel, asyncjs' each
and ES6's Promise.all
will allow you to do that.
Both of these methods take functions as inputs, so you would take the original array of URLs and map
them to the desired input functions and your final output would be an array of results (I'm assuming the responses from the URL fetching).
EDIT: including example code with Promise.each
var myurls = ["url1", "url2", "url3"];
var myPromisifiedFetchRequests = myurls.map(url => fetch(url));
Promise.each(myPromisifiedFetchRequests).then(myFetchedResults => console.log(myFetchedResults));