Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const wait = (millisecondsToWait) => new Promise((resolve) => {
- setTimeout(resolve, millisecondsToWait);
- });
- wait(1000).then(() => {
- console.log("First promise");
- return wait(2000);
- }).then(() => {
- console.log("Second promise");
- return wait(2500);
- }).then(() => {
- console.log("Third promise");
- return wait(3000);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement