When you call a function. This parameter is set to a global object, unless it calls a member method or you call either .call or .apply , which you cannot in your case.
or, in other words, you cannot close more than this , however, you can approach the standard variable to which you assigned it. Therefore, if you have a function nested inside another funtion, and you want to do this:
function outer(){ var _this = this; someThingThatAcceptsACallback(function(){ console.log(_this.state); } }
source share