I had mixed results in the past when I tried to use currying in Javascript. The stack traces were cluttered by references to the currying function and it also masked bugs if you forgot to pass an argument. Without currying, if you pass less arguments than the function expects then you usually get an error right away complaining that the argument is undefined. However, if the function is curried then it silently succeeds. You only notice the problem later, when you try to use the return value and realize that it is actually a function. To make things worse, when this happens the stack trace points to the place that is trying to use the return value instead of pointing to the function call that is the actual source of the problem.<p>My final impression was that currying works better a language like Haskell that has a strong type system. In a dynamic language it is more problematic.
Sorry I'm not that familiar with this. What would be a good use-case for currying?<p>The example doesn't feel that exciting...<p><pre><code> add4(1)(3)(5)(10)
add4(1)(3,5)(10)
add4(1,3,5,10)
// 19</code></pre>
> WTF is Curry?<p>> A Curry takes arguments one by one unlike functions which takes all arguments at once.<p>Took the words right out of my brain.
The old "drop a link" routine isn't beloved here at HN, but this xkcd is just so good:<p><a href="https://xkcd.com/2210/" rel="nofollow">https://xkcd.com/2210/</a>