Callback this context [duplicate]
问题 This question already has answers here : How to access the correct `this` inside a callback? (10 answers) Closed 3 years ago . in App: var bootstrap = new Bootstrap(); bootstrap.init( this, this.onBootstrapComplete ); in Bootstrap: this.init = function( app, completeHandler ){ _app = app; _completeHandler = completeHandler; ... } ... var _allReady = function(){ _completeHandler( _app ); } back in App: this.onBootstrapComplete = function( app ) { app.something(); app.someValue = ... } I wanted