3

Starting Out with Functions – A Core Concept

In Chapter 2, Thinking Functionally, we discussed an example of FP thinking, but now, let’s look at the basics and review functions.

In this chapter, we’ll do the following:

  • Discuss functions in JavaScript, including how to define them, with a particular focus on arrow functions
  • Learn about currying and functions as first-class objects
  • Explore several ways of using functions in an FP way

After going through all this content, you’ll be up to date with the generic and specific concepts relating to functions, which are, after all, at the core of FP!

All about functions

Let’s start with a short review of functions in JavaScript and their relationship to FP concepts. We will begin with something that ...

Get Mastering JavaScript Functional Programming - Third Edition 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.