function DoSomething()
{
var scope = this;
}
Consider the following methods of invoking it: Option 1:
var self= this;
$someElement.change(self.DoSomething);
Option 2:
var self= this;
$someElement.change(function(){self.DoSomething();});
Why is it that the when the change event is triggered, the first line of code results in scope
being the element that triggered the event, but the second results in a scope
that is the same as self
but the second?
Since I don't understand the concept at hand here, it has been difficult for me to Google the correct search term.