I'm trying to acess the first element of this array but every time returns me undefined
I'm trying to acess the first element of this array but every time returns me undefined I used damageRelations[0] but it's not working and i don't know what to do.
types.map((type) => {
console.log(type.url)
fetch(type.url)
.then((response) => response.json())
.then((data) => {damageRelations.push(data)})
})
console.log(damageRelations[0])