Module filter

Source
Expand description

Iterates over elements of array, returning an array of all elements predicate returns truthy for.

Example

use lodash_rust::filter;
 
fn main() {
 let res = filter::new([1, 2, 3, 4].to_vec(), &|x: i32| x < 3);
 println!("{res}") // [1, 2]
}

Functionsยง

new