What is the output?
let nums = [1, 2, 3, 4, 5, 6]
let evens = nums.filter {
$0.isMultiple(of: 2)
}
print(evens)
[spoiler title="Solution"]
Answer:
[2, 4, 6]
Explanation:
filter returns elements matching the predicate condition.
[/spoiler]