NAME

reverse - reverse an array along an axis

SYNOPSIS

arr.reverse()
arr.reverse(axis)

DESCRIPTION

The reverse() method reverses the order of elements in arr along the specified axis. This is similar to APL arr and ⌽[axis]arr.

If axis is not provided, it defaults to the last dimension (-1).

RETURN VALUE

A new array with the elements reversed along the specified axis.

ERRORS

ArgCheck if the number of arguments is incorrect
RangeCheck if axis is out of the valid range of dimensions

EXAMPLE

    a = [1:5]
    a.reverse()
5 4 3 2 1

    b = [2, 2].iterate()
    b.reverse(0)
2 3
0 1

SEE ALSO

rotate
transpose