OxL Reference

method Map.clear

Removes all entries.

Example:

oxl✓ checked in CI
fn main() io {
  var m = {"a": 1, "b": 2}
  m.clear()
  print("{m.len()}")
}
Output
0

Removes all entries.

Example:

oxl✓ checked in CI
fn main() io {
  var m: Map<str, i32> = {"a": 1}
  m.clear()
  print("{m.len()}")
}
Output
0
pub(api) var fn clear()

Complexity. O(n).

Since. 1.0.0-beta

Effects

none declared (pure unless the body says otherwise)

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

See also