Skip to content

Instantly share code, notes, and snippets.

@achisholm
Created May 12, 2014 20:18
Show Gist options
  • Save achisholm/57656d45628a89b4e21c to your computer and use it in GitHub Desktop.
Save achisholm/57656d45628a89b4e21c to your computer and use it in GitHub Desktop.
Problem 5
// Write a function that takes a binary function, and makes it callable with two invocations.
function mul(x, y){
return x * y;
}
function applyf(binary){
return function (x) {
return function (y) {
return binary(x, y);
};
};
}
console.log(applyf (mul) (3) (4));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment