mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
447 B
21 lines
447 B
5 years ago
|
## Currify
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Create the function `currify` that will curry any functions put as argument.
|
||
|
|
||
|
example:
|
||
|
```js
|
||
|
const mult2 = (el1,el2) => el1 * el2
|
||
|
console.log(mult2(2,2)) // result epected 4
|
||
|
|
||
|
|
||
|
const mult2Curried = currify(mult2)
|
||
|
|
||
|
console.log(mult2Curried(2)(2)) // result expected 4
|
||
|
// (same result, with a function that has technically only one argument)
|
||
|
```
|
||
|
|
||
|
### Notions
|
||
|
|
||
|
- https://stackoverflow.com/questions/36314/what-is-currying
|