If I have a ReadonlyArray<T> and I want to obtain another ReadonlyArray<T> with the same items but in reverse order, what's the easiest way to achieve that?
For example:
const scoresInAscendingOrder: ReadonlyArray<number> = [1, 2, 3, 5, 9];
const scoresInDescendingOrder: ReadonlyArray<number> = ???;
I can't use scoresInAscendingOrder.reverse() because ReadonlyArray does not support that method (and rightly so since it would modify scoresInAscendingOrder).