hello!! im stuck on a js thing and i really don t understand why i cant get the data from this map function. it is always undefined.. thank you if someone can help
const getMyList = () => {
fav.map(async(id) => {
try{
const {data:res} = await axios.get(url)
return res
console.log(Arr)
}
catch(error) {
console.log(error)
}
})
setNewArr([...newArr, res])
}
useEffect(() => {
getMyList()
},[]);