Currying functions can be usefull:
function tag(name, value) {
return '<' + name + '>' + value + '</' + name + '>';
}
var strong = tag.bind(undefined, "strong");
strong("text"); // <strong>text</strong>
Now imagine we have to use another function with wrong order of parameters
function otherTag(value, name) {
return '<' + name + '>' + value + '</' + name + '>';
}
How to use bind function to get the same result - create strong tag using otherTag function.
How to curry this function using bind only?
I'm not interested in solution based on wrapping the otherTag function like this:
wrapOtherTag(name, value) {
return otherTag(value, name);
}
What I want to know if it is possible to pass arguments to bind to tell the order of arguments we want to curry.