Quirrel4.41.0

types.Array.reverse

Method on every array
array.reverse(): any

Reverses the array in place.

Return value

This array.

Example

examples/types/array/reverse.nut
let a = [1, 2, 3];
let same = a.reverse();
println("same == a:", same == a);   // returns this array, reversed in place
println("a =", ", ".join(a.map(@(v) v.tostring())));
Output:
same == a: true
a = 3, 2, 1

See also

sortSorts the array in place.
arrayclass index