reverse

Swaps elements of argument array so they all come in reverse order

T[]
reverse
(
T
)
(
T[] array
)

Parameters

array T[]

array slice to reverse in-place

Return Value

Type: T[]

slice of the argument

Examples

test (reverse((int[]).init) == (int[]).init);
test (reverse([1, 2, 3]) == [3, 2, 1]);
test (reverse([1, 2, 3, 4]) == [4, 3, 2, 1]);

Meta