The way that the Functional library implements is to pass the parameters passed to "curry ()" as the first parameters to be passed. The result of the "curry" operation function then takes any additional parameters passed in the call and adds them to the end of the argument list. He doesn't care about the length of the argument list at all, because it's not a fixed thing in JavaScript at all, so it really makes no sense.
Thus:
var curry = myFunction.curry("Tuesday", x + y);
Therefore, the call:
curry(100, true);
will look like a call:
myFunction("Tuesday", x + y, 100, true);
Functional has another function called "partial ()", which allows a more controlled replacement of parameters. When you call "partial ()", you pass a dummy argument ("_") to indicate where the "holes" are in the argument list:
var partialFunc = myFunction.partial("Tuesday", _, 100, true, _, "banana");
These two "_" parameters mean that the received "partialFunc" should discard the first two arguments passed to it in these slots in the argument list:
partialFunc(x + y, "Texas");
this way as a call:
myFunction("Tuesday", x + y, 100, true, "Texas", "banana");
I heartily recommend getting this library and looking at the code. It is surprisingly concise and clear.
One more thing: it’s important to note that since JavaScript is not a lazy evaluation language, it is actually not the same as a curry operation in a lazy functional language such as Haskell. The difference is that the arguments in “curry time” are evaluated and, therefore, sorted “as a result”. In a lazy language, everything is different.