Advertisement
irmantas_radavicius

Untitled

Oct 22nd, 2021
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. let x = 0;
  3.  
  4. console.log("WHILE");
  5. x = 20;
  6. while(x <= 30){ // 0 .. *
  7.     console.log(x);        
  8.     ++x;
  9. }
  10. */
  11. /*
  12. x = 20;
  13. if (x <= 30){ // 0 .. 1
  14.     do {
  15.         console.log(x);    
  16.         ++x;
  17.     } while(x <= 30); // 1 .. *
  18. }
  19. */
  20. /*
  21. console.log("FOR");
  22. for(x = 20; x <= 30; ++x){
  23.     console.log(x);    
  24. }
  25. */
  26. /*
  27. console.log("FOR EACH");
  28. let data = ["Hello", "Labas", "Guten Tag"];
  29. for(let i = 0; i < data.length; ++i){  
  30.     console.log(data[i]);
  31. }
  32. for(let x in data){
  33.     console.log(data[x]);
  34. }
  35. for(let y of data){
  36.     console.log(y);
  37. }
  38. */
  39.  
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement