Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // promises in JS
- var timer = new Promise((resolve, reject) => {
- console.log("Init promise");
- setTimeout(() => {
- console.log("timeout done");
- resolve();
- }, 5000);
- });
- timer.then(() => {
- console.log("Proceed now that timer has concluded");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement