Created
December 12, 2018 13:27
-
-
Save quisido/76308713ca5028ac02a39e974b9603c7 to your computer and use it in GitHub Desktop.
Variable length currying in JavaScript
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
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