Chapter 2. Higher-order JavaScript
This chapter covers
- Why JavaScript is a suitable functional language
- JavaScript as a language that enables multiparadigm development
- Immutability and policies for change
- Understanding higher-order and first-class functions
- Exploring the concepts of closures and scopes
- Practical use of closures
Natural language has no dominant paradigm, and neither does JavaScript. Developers can select from a grab bag of approaches—procedural, functional, and object-oriented—and blend them as appropriate.
Angus Croll, If Hemingway Wrote JavaScript
As applications get bigger, so does their complexity. No matter how good you think you are, turmoil is unavoidable if you don’t have the proper programming models in place. In chapter 1, I explained the reasons functional programming is a compelling paradigm to adopt. But paradigms by themselves are just programming models that need the right host language to come to life.