Skip to content

Instantly share code, notes, and snippets.

@Williammer
Created June 13, 2014 08:51
Show Gist options
  • Select an option

  • Save Williammer/f6e63c860e4e07e977fc to your computer and use it in GitHub Desktop.

Select an option

Save Williammer/f6e63c860e4e07e977fc to your computer and use it in GitHub Desktop.
jsPattern.curryExample.js - one simple curry example to partially add parameters, with closure.
function add(x, y) {
if (typeof y === "undefined") { // partial
return function (y) {
return x + y;
};
}
// full application
return x + y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment