method List.isEmpty
Whether the list has no elements.
Example:
fn main() io {
let xs: List<i32> = []
print("{xs.isEmpty()} {[1].isEmpty()}")
}Output
true false
True when the list has no elements.
Example:
fn main() io {
let xs: List<i32> = []
print("{xs.isEmpty()} {[1].isEmpty()}")
}Output
true false
pub(api) fn isEmpty() -> boolComplexity. O(1).
Since. 1.0.0-beta
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:82