How Do You Rewrite This Closure to Return Zero for all Odd Numbers

var numbers = [20, 19, 7, 12]

 

// Closure

numbers.map({ (number: Int) -> Int

            in

    let result = 3 * number

    return result

 

})

 

Thank you.

God bless, Genesis 1:3

Powered by WPeMatico

You may also like...

Comments are closed.