Skip to content

Instantly share code, notes, and snippets.

@shahab570
Created January 1, 2021 16:18
Show Gist options
  • Save shahab570/953be6673bd1361afca091bf4237b6d2 to your computer and use it in GitHub Desktop.
Save shahab570/953be6673bd1361afca091bf4237b6d2 to your computer and use it in GitHub Desktop.
let take_bath = new Promise((resolve, reject) => {
setTimeout(() => {
resolve("I have finished my bath");
}, 5000);
});
let eat = new Promise((resolve, reject) => {
setTimeout(() => {
reject("I have finished eating");
}, 3000);
});
Promise.all([take_bath,eat]).then((value) => {
console.log(value);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment