Created
December 12, 2018 13:31
-
-
Save quisido/8a4836cc2faa4ef2ecb3dc01811b1d01 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
const addTo1 = addSub(1); // nums = [1] | |
+addTo1(2); // 3 nums = [ 1, 2 ] | |
+addTo1(2); // 1 nums = [ 1, 2, 2 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment