Created
March 10, 2016 18:18
-
-
Save maur1th/49bf2348de8a1ebb13d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const f = () => { | |
return { | |
process() { | |
return Promise.resolve().then(this.other); // Cannot read property 'last' of undefined | |
return Promise.resolve().then(this.other.bind(this)); // WORKS | |
return Promise.resolve().then( () => this.other() ); // WORKS | |
}, | |
other() { | |
return this.last(); | |
}, | |
last() { | |
return console.log('hey'); | |
} | |
}; | |
}; | |
f().process(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment