Answer the question
In order to leave comments, you need to log in
How to get rid of bind in javascript libs?
Increasingly, they notice that inside functions I write code like
...
var a = _.bind(function(options){
...
this.somePropertyToChange = options.doSomething();
this.doSomething();
...
}, this)
...
Answer the question
In order to leave comments, you need to log in
Can promises or even just events/observer help?
_.bind = function (fn, context) {
return function () {
return fn.apply(context, arguments);
};
};
Read something sensible on js and maybe then you will have an understanding.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question