Skip to content

Instantly share code, notes, and snippets.

@danshearmur
Created April 4, 2013 14:14
Show Gist options
  • Save danshearmur/5310695 to your computer and use it in GitHub Desktop.
Save danshearmur/5310695 to your computer and use it in GitHub Desktop.
function times(first, second) {
return first * second;
}
console.log(times(3, 4)); // 12
console.log(times(10, 50)); // 500
console.log(times); // function () {}
function fillFirst(func, first) {
return function (second) {
return func(first, second);
}
}
var times10 = fillFirst(times, 10);
console.log(times10(100)); // 1000
console.log(times10(3)); // 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment