Guest User

Untitled

a guest
Jul 16th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. console.log('script start');
  2.  
  3. requestAnimationFrame(()=> {
  4. console.log("requestanimationframe");
  5. })
  6.  
  7. const interval = setInterval(() => {
  8. console.log('setInterval')
  9. }, 0)
  10.  
  11. setTimeout(function () {
  12. console.log('setTimeout 1');
  13. }, 0);
  14.  
  15. Promise.resolve().then(function () {
  16. console.log('promise1');
  17. }).then(function () {
  18. setTimeout(() => {
  19. console.log('setTimeout 2')
  20. Promise.resolve().then(() => {
  21. console.log('promise 2')
  22. }).then(() => {
  23. console.log('promise 3')
  24. }).then(() => {
  25. clearInterval(interval)
  26. })
  27. }, 0)
  28. });
  29.  
  30. setTimeout(function () {
  31. console.log('setTimeout 3');
  32. }, 0);
  33.  
  34. Promise.resolve().then(function () {
  35. console.log('promise4');
  36. }).then(function () {
  37. console.log('promise5');
  38. });
  39.  
  40. console.log('script end');
Add Comment
Please, Sign In to add comment