Guest User

Untitled

a guest
Apr 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <script>
  5. for (i = 0; i < 5; i++) {
  6. (function() {
  7. var j = i;
  8. var x = Math.floor(Math.random() * 20000);
  9. setTimeout(function () {
  10. // Log Result of i (increment) and x (time)
  11. console.log(j+" "+x);
  12. }, x);
  13. })();
  14. }
  15. </script>
  16. </body>
  17. </html>
Add Comment
Please, Sign In to add comment