To use map() on an array in reverse order with JavaScript, we make a copy before we reverse the array.
For instance, we write
myArray
.slice(0)
.reverse()
.map((a) => {
//...
});
to call slice to make a copy of myArray and return it.
And then we call reverse to reverse the copied array.
Then we call map to map the entries of the reversed array.