Skip to content

Instantly share code, notes, and snippets.

@deepak
Created February 2, 2015 11:08
Show Gist options
  • Save deepak/0f46a683b16e6eb15811 to your computer and use it in GitHub Desktop.
Save deepak/0f46a683b16e6eb15811 to your computer and use it in GitHub Desktop.
can ignore value from promise
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