Created
October 24, 2017 05:25
-
-
Save the-creature/5e1fe98cf9fa4fa67c4a399b99ba2f46 to your computer and use it in GitHub Desktop.
es6Curry.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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