Skip to content

Instantly share code, notes, and snippets.

@ibare
Created February 4, 2020 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibare/8833170781d1ba0d4b0e3803620ac376 to your computer and use it in GitHub Desktop.
Save ibare/8833170781d1ba0d4b0e3803620ac376 to your computer and use it in GitHub Desktop.
Promise.resolve()
.then(() => {
return 'OK'
})
.then(a => `${a} ${Date.now()}`)
.then(b => new Promise((resolve) => {
setTimeout(() => resolve(`${b} + delay`), 1000);
}))
.then(out => console.log(out))
.catch(e => console.error(e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment