mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +00:00
Simplified currying.
^
This commit is contained in:
parent
8235cd9832
commit
ee026cd4da
1 changed files with 1 additions and 5 deletions
|
|
@ -52,11 +52,7 @@ partial(2); //=> 42
|
|||
```js
|
||||
let sum = (a,b) => a+b;
|
||||
|
||||
let curriedSum = function(a) {
|
||||
return function(b) {
|
||||
return a + b;
|
||||
};
|
||||
};
|
||||
let curriedSum = (a) => (b) => a + b;
|
||||
|
||||
curriedSum(40)(2) // 42.
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue