Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. const wait = (millisecondsToWait) => new Promise((resolve) => {
  2. setTimeout(resolve, millisecondsToWait);
  3. });
  4.  
  5. wait(1000).then(() => {
  6. console.log("First promise");
  7. return wait(2000);
  8. }).then(() => {
  9. console.log("Second promise");
  10. return wait(2500);
  11. }).then(() => {
  12. console.log("Third promise");
  13. return wait(3000);
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement