One of the most important ideas in software development is: keep it simple.
The problem is, every developer believes all code they write is simple & beautiful.
Without getting into the tar pit of defining "Simple Code" - I'll show one method which has worked well for me.
Goal: write focused, pluggable & testable functions by following 2 rules:
1. Restrict functions to single-purpose.
AND
2. Restrict functions to only 1 argument (or 2 for (err, value) style).
This can be an array or object with many dimensions.
Let's write some example "Higher Order Functions" to do multiple math steps/functions.
Pure ES2016 - no "frameworks" - just a tape test.