...
/Tip 34: Focused Parameters with Partially Applied Functions
Tip 34: Focused Parameters with Partially Applied Functions
In this tip, you’ll learn to keep parameters focused with partially applied functions.
We'll cover the following...
In the last tip, you saw how you can easily create higher-order functions with arrow functions. If you come from an object-oriented background or just haven’t seen much code that uses higher-order functions, you may have problems understanding when you should use higher-order functions.
Partially applied functions provide unique value by locking in parameters so you can complete the function later while still maintaining access to the original arguments. They also isolate parameters so you can keep intentions clear. In the next tip, you’ll see more about locking in parameter data. In this tip, you’ll see how you leverage higher-order functions to give parameters single responsibility.
Partially applied functions & focused parameters
A higher-order function is a function that returns another function. What this means is that you have at least two rounds of parameters before the function is fully ...