I need to push all the results into an array making async http calls but i need to wait until all of the calls are finished.
async function(){
const arrayWithResults = [];
const urls = ['someurl.com', 'otherurl.com'];
urls.map( url => {
axios.get(url).then( result => {
arrayWithResults.push(result);
}
});
}
Is using await the only option here? i'm afraid of using it since awaiting for each request would slow down the whole process.