I have an object that has several methods, and I want to bind one of them as an event handler, but it uses other methods from the same object. What is the best practice for maintaining context in callback functions? As I see from the jQuery UI kernel, the $ .proxy method is usually used for this purpose, to be honest, I donโt like this approach, itโs not very clear.
Do you have any suggestions? Thanks in advance!
var obj = { someMethod: function(){...}, callback : function(){ ... this.someMethod();
Roman source share