What I learned today | Functional Js | Higher Order Functions – Chapter 4

If you came all the way from part 1, you should get the book: Functional JavaScript

In the last post, we learned about Closures and Scopes. Today, we are addressing Higher Order Functions – Let’s do this!

Higher Order Function

  • A first-class function
  • takes a function as an argument
  • returns a function as a result

Functions that take other functions

  • e.g.map, reduce, filter methods take arrays as first arguments and a function as second
  • By taking a function instead of a value, you are less restricted
    • Use functions, not values

See the Pen Functional JS: Higher Order Functions by Ajala Comfort (@AJALACOMFORT) on CodePen.

That is all I learned about HOF… yes, that was short but yea…