Created
February 2, 2015 11:08
-
-
Save deepak/0f46a683b16e6eb15811 to your computer and use it in GitHub Desktop.
can ignore value from promise
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
let pr1 = new Promise( (resolve, reject) => { | |
resolve(1); | |
}); | |
// ignored value. | |
// would have been nice of function is required to have correct arguments | |
// TODO: try with JSHint | |
pr1.then( () => { | |
console.log("hello"); | |
}) | |
let pr2 = new Promise( (resolve, reject) => { | |
resolve(1); | |
}); | |
// logged value | |
pr1.then( (x) => { | |
console.log(`hello ${x}`); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment