Skip to content

Instantly share code, notes, and snippets.

@Mayankgupta688
Created February 7, 2021 08:32
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 Mayankgupta688/a24ab73ed4702c145f02611b439fe66b to your computer and use it in GitHub Desktop.
Save Mayankgupta688/a24ab73ed4702c145f02611b439fe66b to your computer and use it in GitHub Desktop.
var firstPromise = new Promise((resolve, reject) => {
setTimeout(() => {
reject("This is Promise One...")
}, 3000)
});
firstPromise.then((resolvedData) => {
console.log(`Promise Resolved with the Data: ${resolvedData}`)
}, (rejectedData) => {
console.log(`Promise Rejected with the Data: ${rejectedData}`)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment