Skip to content

Instantly share code, notes, and snippets.

@apnerve
Created December 10, 2021 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apnerve/1fbed12ac5ca5cc05f87df58649840d3 to your computer and use it in GitHub Desktop.
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
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