/array/reverse
stdReverses the given array without mutating it (in contrast to Array.reverse).
Type signature
<T>(xs: T[]) => T[]
Examples
reverse([1, 2, 3, 4, 5]);
// ⇒ [5, 4, 3, 2, 1]
Try in REPL
Questions
- How to reverse an array without mutating it?