Skip to content

Instantly share code, notes, and snippets.

@achisholm
Created May 12, 2014 20:33
Show Gist options
  • Save achisholm/1f6023bf4784a2526517 to your computer and use it in GitHub Desktop.
Save achisholm/1f6023bf4784a2526517 to your computer and use it in GitHub Desktop.
Problem 6
// 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