Skip to content

Instantly share code, notes, and snippets.

@onosendi
Created January 31, 2022 02:21
Show Gist options
  • Select an option

  • Save onosendi/9e0fbc296fc2b3defc486ef19233fb13 to your computer and use it in GitHub Desktop.

Select an option

Save onosendi/9e0fbc296fc2b3defc486ef19233fb13 to your computer and use it in GitHub Desktop.
function promiseChain() {
return new Promise((resolve) => { resolve('two'); });
}
console.log('one');
promiseChain()
.then((result) => {
console.log(result);
})
.then(() => {
console.log('three');
});
console.log('four');
// one
// four
// two
// three
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment