So, below is a very barebones example of a case where I'd set that to this so I can use the scope of myObj. How would I integrate Function.prototype.bind, just so I can see how I can use it in the future?
var myObj = {
specialFunction: function () {
},
anotherSpecialFunction(){
},
getAsyncData: function (cb) {
// an operation
cb();
},
render: function () {
var that = this;
this.getAsyncData(function () {
that.specialFunction();
that.anotherSpecialFunction();
});
}
};
myObj.render();
thatwould give the scope ofrenderfunction in your case and not ofmyObjgetAsyncDatadefined? Is it suppose to be myObj.getAsyncData?