我正在编写一些 JavaScript 代码。我对这个关键字有点困惑。如何访问dataReceivedHandler
函数中的记录器变量?
MyClass: {
logger: null,
init: function() {
logger = LogFactory.getLogger();
},
loadData: function() {
var dataReceivedHandler = function() {
// how to access the logger variable here?
}
// more stuff
}
};