Using functional programming to avoid intermediate variables and nested functions

added by JavaScript Kicks
8/29/2019 6:37:20 AM


Often when we're developing a piece of code, we need to take one starting value and apply several functions to it before we return that value. Something like: The problem with this is that it's difficult to read. Whenever you add intermediate variables ( incompleteTasks, withoutBlockedTasks, etc.), you have to track which ones are passed as arguments to the next functions.