Created
May 12, 2014 20:33
-
-
Save achisholm/1f6023bf4784a2526517 to your computer and use it in GitHub Desktop.
Problem 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Write a function that takes a function and an argument, and returns a function that can supply a second argument. | |
function add(x,y){ | |
return x + y; | |
} | |
function mul(x,y){ | |
return x * y; | |
} | |
function curry(a,b){ | |
return function (c) { | |
return a(b,c); | |
}; | |
} | |
add3 = curry(add, 3); | |
console.log(add3(4)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment