Skip to content

Instantly share code, notes, and snippets.

@the-creature
Created October 24, 2017 05:25
Show Gist options
  • Save the-creature/5e1fe98cf9fa4fa67c4a399b99ba2f46 to your computer and use it in GitHub Desktop.
Save the-creature/5e1fe98cf9fa4fa67c4a399b99ba2f46 to your computer and use it in GitHub Desktop.
es6Curry.js
const whoAmI = name => field => location =>
name + ' is a ' + field + ' from ' + location;
const first = whoAmI('Liccy Fuentes');
const two = first('Front End Developer');
console.log(two('Florida'));
function curry(fn, ...args1) {
return (...args2) => fn(...args1, ...args2);
}
function add(x, y) {
return x + y;
}
const test = curry(add, 1);
console.log(test(2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment