Quiz · Closures and iterators · lesson 7 of 7
Quiz — a chain and laziness
Question 1 of 2
What does the program print?
fn main() {
let v: Vec<i32> = (1..=5).filter(|n| n % 2 == 1).map(|n| n * n).collect();
println!("{v:?}");
}What does the program print?
fn main() {
let v: Vec<i32> = (1..=5).filter(|n| n % 2 == 1).map(|n| n * n).collect();
println!("{v:?}");
}