File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
1-js/99-js-misc/03-currying-partials Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ function sum(a, b) {
3131 return a + b;
3232}
3333
34- let carriedSum = curry (sum);
34+ let curriedSum = curry (sum);
3535
36- alert ( carriedSum (1 )(2 ) ); // 3
36+ alert ( curriedSum (1 )(2 ) ); // 3
3737```
3838
3939As you can see, the implementation is straightforward: it's just two wrappers.
@@ -49,10 +49,10 @@ function sum(a, b) {
4949 return a + b;
5050}
5151
52- let carriedSum = _ .curry (sum); // using _.carry from lodash library
52+ let curriedSum = _ .curry (sum); // using _.curry from lodash library
5353
54- alert ( carriedSum (1 , 2 ) ); // 3, still callable normally
55- alert ( carriedSum (1 )(2 ) ); // 3, called partially
54+ alert ( curriedSum (1 , 2 ) ); // 3, still callable normally
55+ alert ( curriedSum (1 )(2 ) ); // 3, called partially
5656```
5757
5858## Currying? What for?
You can’t perform that action at this time.
0 commit comments