3 ms·
What you're missing is that the curry() function is generic: you don't need to manually write that new function, but just type a simple oneliner using curry() t
by ttiurani 5y ago
What you're missing is that the curry() function is generic: you don't need to manually write that new function, but just type a simple oneliner using curry() to generate the function you're describing.
- leodriesch 5y agoDefining one function that just calls another with a fixed argument is also a one-liner with arrow functions. And I would argue that this would be easier to understand and anyone reading the code wouldn’t have to understand what currying is.
- ttiurani 5y agoI agree that the benefit is miniscule even when both the writer and the readers are familiar with currying. Which is why I personally never use curry methods to keep the cognite load low, and instead do just that.