
Currying in JavaScript ES6 - matthberg
https://medium.com/@adambene/currying-in-javascript-es6-540d2ad09400
======
FrozenVoid

       //Translated to C
       #include <stdio.h>
       #include <stdlib.h>
       #define CurriedMultiply(m) multiply(n,m)
       int multiply(int n,int m){return n*m;}
       int triple(int n){return CurriedMultiply(3);}
       int main(int argc,char**argv){
       printf("result:%d\n",triple(strtol(argv[1],NULL,10)));   
       }

------
taylodl
Currying is also a means for adapting a function for memoization. I blogged
about this a while back:

[https://taylodl.wordpress.com/2013/11/05/functional-
javascri...](https://taylodl.wordpress.com/2013/11/05/functional-javascript-
currying/)

------
bastawhiz
I don't think any of these examples of "currying" are actually examples of
currying.

~~~
grzm
Would you elaborate why you think so?

~~~
bastawhiz
You should be able to curry any arbitrary function with an arbitrary number of
arguments. Providing a value for the last argument should return the evaluated
result of the curried function. If you're not using a JavaScript function's
`.length` property to do currying, it's by definition not currying.

