Chapter 2. Fundamentals of Functional Programming
By now, you've seen a small glimpse of what functional programming can do. But what exactly is functional programming? What makes one language functional and not another? What makes one programming style functional and not another?
In this chapter, we will first answer these questions and then cover the core concepts of functional programming:
- Using functions and arrays for control flow
- Writing pure functions, anonymous functions, recursive functions, and more
- Passing functions around like objects
- Utilizing the
map()
,filter()
, andreduce()
functions
Functional programming languages
Functional programming languages are languages that facilitate the functional programming paradigm. At the risk of oversimplifying, we could say that, if a language includes the features required for functional programming, then it is a functional language—as simple as that. In most cases, it's the programming style that truly determines whether...