OxL Reference

method Map.len

The number of entries.

Example:

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

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
pub(api) fn len() -> usize

Complexity. O(1).

Since. 1.0.0-beta

Returns

usize

Effects

none declared (pure unless the body says otherwise)

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

See also