reverse

Reverses the elements of an array.

reverse

Reverses the elements of an array.

Type: transform

Aliases

arrayReverse, reverse

Parameters

  • input (array): The input values to reverse.

Returns

Type: array

A new array with elements in reverse order, or empty array if no valid input.

Examples

reverse([1, 2, 3]) // [3, 2, 1]
[1, 2, 3]|reverse // [3, 2, 1]
reverse(["a", "b", "c"]) // ["c", "b", "a"]
Cookie Notice

We use cookies to enhance your browsing experience.