fun/array/reverse

Composable version of array reverse. Unlike Array.prototype.reverse however, fun/array/reverse is a pure function and does not mutate the given array in place.

Syntax

rev = reverse(arr)

Parameters

  • arr The array to be reversed. It will not be mutated.

Examples

var arr = [1, 2, 3]
var rev = reverse(arr) // [3, 2, 1]

rev === arr // false