Skip to content

Instantly share code, notes, and snippets.

@kavitshah8
Forked from ryansukale/PromisesExamples.js
Created June 28, 2015 07:33
Show Gist options
  • Save kavitshah8/4d259ecf7e9a6fbc51c1 to your computer and use it in GitHub Desktop.
Save kavitshah8/4d259ecf7e9a6fbc51c1 to your computer and use it in GitHub Desktop.
Promise.resolve().then(function () {
return 100;
})
.then(function() {
console.log(arguments);
});
// ---
Promise.resolve(200).then(function () {
console.log(arguments);
return Promise.resolve(100);
})
.then(function(arg1) {
console.log(arguments);
});
// ---
Promise.resolve().then(function () {
return 100;
}).then(function () {
console.log('1', arguments);
})
.then(function() {
console.log('2', arguments);
});
// ---
Promise.resolve().then(function () {
return 100;
})
.then(null)
.then(null)
.then(null)
.then(function() {
console.log(arguments);
})
.then(null)
.then(function() {
console.log(arguments);
});
// ---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment