Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. const check = () => {
  2. const arr = [3,2,1]
  3.  
  4. arr.forEach(async (val) => {
  5. await setTimeout(() => console.log(val), val*1000)
  6. })
  7. }
  8.  
  9. check();
  10.  
  11. 1
  12. 2
  13. 3
  14.  
  15. 3
  16. 2
  17. 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement