Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. function curry(anyFunction, firstParameter) {
  2. return function(secondParameter) {
  3. return anyFunction(firstParameter, secondParameter);
  4. };
  5. }
  6.  
  7. function add(a, b) {
  8. return a + b;
  9. }
  10.  
  11. var increment = curry(add, 1);
  12.  
  13. console.log(increment(10)); // 11
  14. console.log(increment(100)); // 101
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement