8.Last Practice for Loop


On section 5.8, Last Practice for loop

The code below is just returning 0. Seeing the message "Oops, try again. Your loop didn't log 100 to the console!". Cant work out what I'm doing wrong. Any help please? Thanks!

for ( var i = 100; i>0; i-=5); {



for ( var i = 100; i>0; i-=5); // this one

your last semi-colon interrupts your loop, it doesn't belong there. Remove the semi-colon


Or rather, it does nothing 20 times, since the statement to repeat is an empty statement


Ah yes I see now! Thanks for your help!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.