What's the difference in calling a function in these two cases?
var doSomething = function( doSomethingElse ) {
// Some great things here before the doSomethingElse function call
doSomethingElse();
}
// 1. case
var _this = this;
doSomething( function () {
_this.doSomethingElse();
});
// 2. case
doSomething( this.doSomethingElse );
In the first case it will find the doSomethingElse properly. The second case does not work as expected.
Thanks!