File tree 1 file changed +5
-5
lines changed
1-js/99-js-misc/03-currying-partials
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) {
31
31
return a + b;
32
32
}
33
33
34
- let carriedSum = curry (sum);
34
+ let curriedSum = curry (sum);
35
35
36
- alert ( carriedSum (1 )(2 ) ); // 3
36
+ alert ( curriedSum (1 )(2 ) ); // 3
37
37
```
38
38
39
39
As you can see, the implementation is straightforward: it's just two wrappers.
@@ -49,10 +49,10 @@ function sum(a, b) {
49
49
return a + b;
50
50
}
51
51
52
- let carriedSum = _ .curry (sum); // using _.carry from lodash library
52
+ let curriedSum = _ .curry (sum); // using _.curry from lodash library
53
53
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
56
56
```
57
57
58
58
## Currying? What for?
You can’t perform that action at this time.
0 commit comments