OxL Reference

method List.reverse

Reverses the order of the elements in place.

Example:

oxl✓ checked in CI
fn main() io {
  var xs = [1, 2, 3]
  xs.reverse()
  print("{xs}")
}
Output
[3, 2, 1]

Reverses the list in place.

Example:

oxl✓ checked in CI
fn main() io {
  var xs = [1, 2, 3]
  xs.reverse()
  print("{xs}")
}
Output
[3, 2, 1]
pub(api) var fn reverse()

Complexity. O(n).

Since. 1.0.0-beta

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/collections.oxl:326

See also