Final thoughts
Let’s finish this chapter with some short topics. First, we should consider how we’d apply the methods in this chapter to a function with a variable number of parameters – not a trivial point, as all the code we’ve seen strongly depends on the function’s arity.
Then we’ll finish with two more philosophical considerations regarding currying and partial application, which may cause a bit of a discussion:
- First, many libraries are just wrong about the order of their parameters, making them harder to use
- Second, I don’t usually even use the higher-order functions in this chapter, going for simpler JavaScript code
That’s probably not what you were expecting at this time, so let’s first solve the problem with the functions with an unknown number of parameters, and then go over the last two points in more detail, so you’ll see it’s not a matter of do as I say, not as I do... or...