Skip to content

Instantly share code, notes, and snippets.

@marcuszierke
Created March 24, 2020 16:32
Show Gist options
  • Save marcuszierke/9e3e4f5f79a7918b0581969204889e32 to your computer and use it in GitHub Desktop.
Save marcuszierke/9e3e4f5f79a7918b0581969204889e32 to your computer and use it in GitHub Desktop.
Summarizer
summarizer = (sum) => {
if (sum === 0) {
return 0;
}
return sum + summarizer(sum - 1);
}
console.log(summarizer(100));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment