Advertisement
mr_anastasov

BreakAndContinue

Feb 8th, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let num = 3;
  2. let  counter = 1;
  3.  
  4. while (counter <= num) {
  5.     let stars = 0;
  6.     let starline = '';
  7.  
  8.     while (true) {
  9.         if (stars === counter) {
  10.             break;
  11.         }
  12.     stars++;
  13.     starline = starline + '*';
  14.     }
  15. console.log(starline);
  16. counter++;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement