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

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s