init Map.new
True when the map has no entries.
Example:
fn main() io {
let m: Map<str, i32> = {:}
print("{m.isEmpty()}")
}Output
true
Number of entries.
Example:
fn main() io {
let m: Map<str, i32> = {"a": 1, "b": 2}
print("{m.len()}")
}Output
2
An empty map.
Example:
fn main() io {
let m = Map<str, i32>.new()
print("{m.len()}")
}Output
0
pub(api) init new() -> SelfSince. 1.0.0-beta
Returns
Self
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:603