0

I need some help with my task

for(gg = 1; gg <= 16;){ if (gg == 13){ continue; } console.log(gg++) } This is a loops script. Hm hee is right? It must write in console (1 2 3 4 5 6 7 8 9 10 11 12 14 15) without 13!!!! But when i write it console just stops at the number 12 and it looks like i wrote “break;” but not “continue “ Wtf

12th Oct 2020, 9:03 PM
Alex Lovser
Alex Lovser - avatar
1 Antwort
+ 2
for(let gg=1;gg<=16;gg++){ if(gg==13){ continue; } console.log(gg); } In your code when gg is equal to 13 loop starts again and since the value is still 13 it is stuck in that loop
12th Oct 2020, 9:40 PM
Abhay
Abhay - avatar