Reply to How Do You Rewrite This Closure to Return Zero for all Odd Numbers This seems to work and is nice and easy: numbers.map({ (number: Int) -> Int in return number % 2 == 0 ? number : 0 }) Programming Languages Swift Feb ’22