Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. // promises in JS
  2. var timer = new Promise((resolve, reject) => {
  3. console.log("Init promise");
  4.  
  5. setTimeout(() => {
  6. console.log("timeout done");
  7.  
  8. resolve();
  9. }, 5000);
  10. });
  11.  
  12. timer.then(() => {
  13. console.log("Proceed now that timer has concluded");
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement