It's a neat solution and a good demo of the cool stuff you can do with Javascript. I kinda doubt the practicality, though. If I wanted to do something like that in production, I think I'd rather just define a new function right there, since you could curry any argument order you wanted instead of only in order, and you could name everything more clearly and have the code that you're running right there instead of in a far-away library.
Like if you had to call a method like this:
sendMessage(sender, receiver, data);
a bunch of times with the same receiver but different senders, you could define:
function sendMessageToBob(sender, data) {
sendMessage(sender, bob, data);
}
Like if you had to call a method like this:
sendMessage(sender, receiver, data);
a bunch of times with the same receiver but different senders, you could define:
function sendMessageToBob(sender, data) { sendMessage(sender, bob, data); }