Guest User

Untitled

a guest
Oct 18th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. // Author: GNXB (Apiwith)
  2.  
  3. const data = [1,2,3];
  4. const delay = t => new Promise(r => setTimeout(r, t));
  5.  
  6. async function loop(d) {
  7. for (var i in d) {
  8. // Any statments;
  9. console.log(i);
  10.  
  11. // Make for-loop delay
  12. await delay(1000);
  13. }
  14. }
  15.  
  16. // Execute
  17. loop(data);
Add Comment
Please, Sign In to add comment