OxL Reference

method List.push

Appends an element.

Example:

oxl✓ checked in CI
fn main() io {
  var xs: List<i32> = [3, 1, 2]
  xs.push(4)
  print("{xs}")
}
Output
[3, 1, 2, 4]
pub(api) var fn push(x: T)

Since. 1.0.0-beta

Parameters

NameType
xT

Effects

none declared (pure unless the body says otherwise)

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

See also