I am fetching an array of objects from the server and I use "map" to render the array elements as following :
data.map((item, index) => {
<div>{item.index + 1}</div>
<div>{item.name}</div>
<div>{item.price}</div>
})
and I get a list of items starting from index 1 in ascending order. What I want to do is, I want to rearrange the array in a descending order instead. I want the first element rendered with the latest index that indicates the last element of the array. Is there a way to achieve this in javascript and ReactJs. Thanks in advance.