Skip to content

Instantly share code, notes, and snippets.

@quisido
Created December 12, 2018 13:27
Show Gist options
  • Save quisido/76308713ca5028ac02a39e974b9603c7 to your computer and use it in GitHub Desktop.
Save quisido/76308713ca5028ac02a39e974b9603c7 to your computer and use it in GitHub Desktop.
Variable length currying in JavaScript
addSubtract(1)(2)(3); // 1 + 2 - 3 = 0
addSubtract(1)(2)(3)(4)(5)(6); // 1 + 2 - 3 + 4 - 5 + 6 = 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment