OxL Reference

init Map.new

True when the map has no entries.

Example:

oxl✓ checked in CI
fn main() io {
  let m: Map<str, i32> = {:}
  print("{m.isEmpty()}")
}
Output
true

Number of entries.

Example:

oxl✓ checked in CI
fn main() io {
  let m: Map<str, i32> = {"a": 1, "b": 2}
  print("{m.len()}")
}
Output
2

An empty map.

Example:

oxl✓ checked in CI
fn main() io {
  let m = Map<str, i32>.new()
  print("{m.len()}")
}
Output
0
pub(api) init new() -> Self

Since. 1.0.0-beta

Returns

Self

Effects

none declared (pure unless the body says otherwise)

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

See also