Skip to content

Instantly share code, notes, and snippets.

@adambene
Last active May 24, 2017 02:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adambene/08faf556642df54cfec7a17406b9c27f to your computer and use it in GitHub Desktop.
Save adambene/08faf556642df54cfec7a17406b9c27f to your computer and use it in GitHub Desktop.
Currying in JavaScript ES6 - curry
multiply = (n, m) => (n * m)
multiply(3, 4) === 12 // true
curryedMultiply = (n) => ( (m) => multiply(n, m) )
triple = curryedMultiply(3)
triple(4) === 12 // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment