Created
March 24, 2020 16:32
-
-
Save marcuszierke/9e3e4f5f79a7918b0581969204889e32 to your computer and use it in GitHub Desktop.
Summarizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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