Fix invalid function name
curried() -> curriedSum()
This commit is contained in:
parent
46bdbde7bd
commit
d55932273f
1 changed files with 3 additions and 3 deletions
|
@ -234,13 +234,13 @@ function sum(a, b, c) {
|
||||||
let curriedSum = curry(sum);
|
let curriedSum = curry(sum);
|
||||||
|
|
||||||
// still callable normally
|
// still callable normally
|
||||||
alert( curried(1, 2, 3) ); // 6
|
alert( curriedSum(1, 2, 3) ); // 6
|
||||||
|
|
||||||
// get the partial with curried(1) and call it with 2 other arguments
|
// get the partial with curried(1) and call it with 2 other arguments
|
||||||
alert( curried(1)(2,3) ); // 6
|
alert( curriedSum(1)(2,3) ); // 6
|
||||||
|
|
||||||
// full curried form
|
// full curried form
|
||||||
alert( curried(1)(2)(3) ); // 6
|
alert( curriedSum(1)(2)(3) ); // 6
|
||||||
```
|
```
|
||||||
|
|
||||||
The new `curry` may look complicated, but it's actually pretty easy to understand.
|
The new `curry` may look complicated, but it's actually pretty easy to understand.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue