Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Created February 25, 2018 10:35
Show Gist options
  • Save a1exlism/934ca19fdb1e4b089274a4da0fa9d050 to your computer and use it in GitHub Desktop.
Save a1exlism/934ca19fdb1e4b089274a4da0fa9d050 to your computer and use it in GitHub Desktop.
var aPromise = new Promise(function (resolve) {
resolve(100);
// promise 1
});
aPromise.then(function (value) {
return value * 2;
// return new Promise | promise 2
});
aPromise.then(function (value) {
return value * 2;
// return new Promise | promise 3
});
aPromise.then(function (value) {
console.log("1: " + value); // LOG: 100
// return new Promise | promise 3
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment