Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function curry(anyFunction, firstParameter) {
- return function(secondParameter) {
- return anyFunction(firstParameter, secondParameter);
- };
- }
- function add(a, b) {
- return a + b;
- }
- var increment = curry(add, 1);
- console.log(increment(10)); // 11
- console.log(increment(100)); // 101
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement