how to do async await on a forEach function [duplicate]
问题 This question already has answers here : Using async/await with a forEach loop (18 answers) Closed 2 years ago . I'm a beginner in async await and promises. I read few articles and watch few tutorial videos but I am still not able to understand it completely. So I have a code that I'm working on right now }).then(function() { var responseArray = [] [url1,url2,url3,url4].forEach((url)=>{ makeRequest(url) }).then((response)=>{ responseArray.push(response) }) return responseArray }) So as