Tip 34 Maintain Single Responsibility Parameters with Partially Applied Functions

In this tip, you’ll learn to keep parameters focused with partially applied functions.

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.

Higher-order 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 ...

Get Simplifying JavaScript 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.