0
I have an array of objects and am trying to iterate with the map
in that array after the method of sort
, but it is iterating in the normal array, disregarding the method sort
and the reordering.
{this.mapasVetados
.sort((a,b) => {
return a.ordem - b.ordem
})
.map(mapa => {
if (mapa.vetado) {
return (<Vetados
mapa = {mapa.nome}
ordem = {mapa.ordem}
/>)
}
})
}
You can create a Minimum, Complete and Verifiable Example of the problem.
– Isac
I don’t think so. map works, but iterates out of order, so I’m doing something wrong in . Sort
– Rodolpho