I am trying to loop over an array of URLs and go fetch the data at that URL's endpoint then store it as JSON objects in an array (allData). When I run my code and check what's in allData it is continuously an array of nulls. This tells me I'm not returning correctly from the .map? How do I do that given the data is coming from an async function. Here's my code below. Thanks
const allData = urls.map((url)=>{
fetch(url)
.then(response => response.json())
.then((data) => {return data})
.catch(err => console.log(err))
})