Skip to content

Instantly share code, notes, and snippets.

@clucasalcantara
Last active July 8, 2017 22:44
Show Gist options
  • Save clucasalcantara/e3f7818a0d9bb8cee8ebe10436ec69ad to your computer and use it in GitHub Desktop.
Save clucasalcantara/e3f7818a0d9bb8cee8ebe10436ec69ad to your computer and use it in GitHub Desktop.
currying-eveything!
// Thanks Matheus Marciglio: https://github.com/mtmr0x
// This is a regular and not curried function
const sum = function(x, y) => x + y
sum(1, 2) // 3
// With Currying technique we transform that into a curried function
const currySum = (x) => (y) => x + y
currySum(1)(2) // 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment