Higher Order Functions  Map, filter, reduce and flatMap in Swift 3.0

Map

Loops over a collection and applies the same operation to each element in the collection.

Map

Filter

Loops over a collection and returns an array that contains elements that meet a condition.

Filter

Reduce

Combines all items in a collection to create a single value.

Reduce

FlatMap

When implemented on sequences : Flattens a collection of collections.

FlatMap

Higher Order Functions  Map, filter, reduce and flatMap in Swift 3.0