Skip to content

Instantly share code, notes, and snippets.

@yalovek
Created October 17, 2016 07:03
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 yalovek/3a3f32f54df2c832462aceffa524fd6d to your computer and use it in GitHub Desktop.
Save yalovek/3a3f32f54df2c832462aceffa524fd6d to your computer and use it in GitHub Desktop.
Calculating sum of numbers sum(2)(3)(4)
function sum(x) {
const f = y => sum(x + y);
f.valueOf = () => x;
return f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment