for-loop vs filter()
Here’s the code if you want to experiment with it!
import Foundation
let integers = [1, 2, 3, 4, 5]
let evensOnly = integers.filter { $0.isMultiple(of: 2) }
Here’s the code if you want to experiment with it!
import Foundation
let integers = [1, 2, 3, 4, 5]
let evensOnly = integers.filter { $0.isMultiple(of: 2) }