I'm getting my head wrapped about currying and other techniques using Function.prototype.bind
.
It seems extremely useful to change function scope (i.e., this
value) in certain situations.
However it looks like you can't change the scope with bind
once you already did so:
function f = obj.method.bind(42);
function g = obj.method.bind('Hi');
function f2 = f.bind('Hi'); // “this” is still 42
Is it possible to retrieve the original unbound function from a bound function at all?