We can see that I'm repeating the 2 a lot. What is great about curried functions is that they can be used to compose higher order functions (a higher order function is a function that either takes a function as parameter or returns a new one), and so helping us reuse some parameters that are commons accross function calls.
And this is, in my opinion, what makes currying so powerful. Composing functions helps you decrease the needs for repeating common parts of your application.
Thanks for the explanation,I tried to introduce the characteristic of flexibility, although this approach that you said was the most common as to the power of currying.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi there and thanks for your article!
In my opinion, this article deserves a little bit more explanations, especially the usefulness of using curried functions.
If I start from your example.
Even though you have successfully curried your function, we can see that the
2
&3
parameters could have been reused. Now if I take this example.We can see that I'm repeating the
2
a lot. What is great about curried functions is that they can be used to compose higher order functions (a higher order function is a function that either takes a function as parameter or returns a new one), and so helping us reuse some parameters that are commons accross function calls.And this is, in my opinion, what makes currying so powerful. Composing functions helps you decrease the needs for repeating common parts of your application.
This is what I was expecting to read!
Thanks for the explanation,I tried to introduce the characteristic of flexibility, although this approach that you said was the most common as to the power of currying.