method List.reverse
Reverses the order of the elements in place.
Example:
fn main() io {
var xs = [1, 2, 3]
xs.reverse()
print("{xs}")
}Вывод
[3, 2, 1]
Reverses the list in place.
Example:
fn main() io {
var xs = [1, 2, 3]
xs.reverse()
print("{xs}")
}Вывод
[3, 2, 1]
pub(api) var fn reverse()Сложность. O(n).
С версии. 1.0.0-beta
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/collections.oxl:326