That's nice to know, but sadly doesn't answer the question. Why would I do that to my JS code? What are the advantages and do they outweigh the disadvantages of introducing all these context switches?
Curious, why are you so concerned with "context switches"? A function should only have knowledge of what it has been given.
Being able to pipe functions together is where the power (and fun) comes in! Have a look at F# For Fun and Profit for a reference on thinking functionally.
Also, see what they say specifically about currying.
I know these are referring to a different language, but the baisc principals remain. Hope this helps you! I'll try to come up with some "real-world" examples time permitting. Cheers.
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.
That's nice to know, but sadly doesn't answer the question. Why would I do that to my JS code? What are the advantages and do they outweigh the disadvantages of introducing all these context switches?
Curious, why are you so concerned with "context switches"? A function should only have knowledge of what it has been given.
Being able to pipe functions together is where the power (and fun) comes in! Have a look at F# For Fun and Profit for a reference on thinking functionally.
Also, see what they say specifically about currying.
I know these are referring to a different language, but the baisc principals remain. Hope this helps you! I'll try to come up with some "real-world" examples time permitting. Cheers.