Starting Out with Functions - A Core Concept

In chapter 2Thinking Functionally - A First Example, we went over an example of FP thinking, but let's now go to the basics, and review functions. In Chapter 1, Becoming Functional - Several Questions, we mentioned that two important JS features were functions as first-class objects and closures. Now, in this chapter, let's:

  • Examine some key ways of defining functions in JS
  • Go in detail regarding arrow functions, which are closest to the lambda calculus functions
  • Introduce the concept of currying
  • Revisit the concept of functions as first-class objects

We'll also consider several FP techniques, such as:

  • Injection, as needed for sorting with different strategies and other uses
  • Callbacks and ...

Get Mastering Javascript Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.