Skip to content

Instantly share code, notes, and snippets.

@zaetrik
Created May 9, 2020 07:40
Show Gist options
  • Save zaetrik/c843cbd0bb620d78a3c2198c899f8ee4 to your computer and use it in GitHub Desktop.
Save zaetrik/c843cbd0bb620d78a3c2198c899f8ee4 to your computer and use it in GitHub Desktop.
Currying Example
const add = (x, y) => x + y
const addCurried = (x) => (y) => x + y
// Or to make it more clear we can write it like this =>
function takeInFirstParameter(x) {
return function takeInSecondParameter(y) {
return x + y
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment