Question:

When this code is executed, how many items will the result array contain?

let numbers = [1, 3, 5, 7, 9]
let result = numbers.filter { $0 >= 5 }

Correct answer: 3.

Explanation: The call to filter will return items from the numbers array only if they are greater than or equal to 5.


Keywords:

© 2017 QuizBucket.org