Skip to content

Instantly share code, notes, and snippets.

@anshuraj
Created April 28, 2020 10:31
Show Gist options
  • Save anshuraj/ceb3052ab7d08a72d826b3cf437ac2c4 to your computer and use it in GitHub Desktop.
Save anshuraj/ceb3052ab7d08a72d826b3cf437ac2c4 to your computer and use it in GitHub Desktop.
sum(2)(3)(4)...(n)
function sum (a) {
return function (b) {
if (b) {
return sum(a + b);
} else {
return a;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment