May 27, 2016

Higher order functions

What? Functions you can pass as arguments to other functions. Such as map, filter, reduce, flatMap.

  • map - operate on each element in the collection (then return a new collection).
  • filter - return a subset of the collection that satisfies some condition. 
  • reduce - combine and return a single value. 
  • flatMap - flatten a collection of collections into a collection.