Is it possible to reference the context of the outer function without reassigning the context to some local variable?
For example:
var objects = [];
// populate objects
Foo.prototype.bar = function() {
var outerObject = this;
$.each(objects, function () {
this.someMethod(outerObject);
});
};
You could use .bind, otherwise, you have to store
thiswith a local variable.Update:
For your case: