Summary
In this chapter, we learned how to write HOFs of our own that can either wrap another function to provide some new feature, alter a function’s objective so that it does something else, or even provide totally new features, such as decoupling methods from objects or creating better finders. The main takeaway from this chapter is that you have a way of modifying a function’s behavior without actually having to modify its own code; HOFs can manage this in an orderly way.
In Chapter 7, Transforming Functions, we’ll keep working with HOFs and learn how to produce specialized versions of existing functions with predefined arguments by using currying and partial application.