Created
December 10, 2021 16:42
-
-
Save apnerve/1fbed12ac5ca5cc05f87df58649840d3 to your computer and use it in GitHub Desktop.
Write a function sum such that sum(a)(b)(c)...(n)() returns a+b+c+...+n
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
const sum = x => y => y ? sum(x+y) : x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment