![Swift Functional Programming(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/293/36701293/b_36701293.jpg)
上QQ阅读APP看书,第一时间看更新
The filter function
The filter function is a higher-order function that takes a function that, given an element in the array, returns Bool, indicating whether the element should be included in the resulting array. Consider the following example:
let evenNumbers = numbers.filter { $0 % 2 == 0 }