Guest User

Untitled

a guest
Mar 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. // This example solve the entire post problem using ES6 'let' keyword
  2. for(let i = 0; i < 10; i++) {
  3. setTimeout(() => {
  4. console.log(`The number is ${i}`);
  5. }, 1000);
  6. }
  7.  
  8. /*
  9. # Output should be show below type:
  10.  
  11. The number is 0
  12. The number is 1
  13. The number is 2
  14. The number is 3
  15. The number is 4
  16. The number is 5
  17. The number is 6
  18. The number is 7
  19. The number is 8
  20. The number is 9
  21. */
Add Comment
Please, Sign In to add comment