Last practice for loop


#1


Replace this line with your code.


#2

for (var i = 100 ; i > 0; i -=5 );{console.log(i)}

why is not printing 100?


#3

the last semi-colon:

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

prevents the loop from executing properly, wrongly placed semi-colons can cause trouble


#4

Executes very properly, but repeatedly doing nothing doesn't have much effect. The statement to be repeated was an empty statement. The next statement wasn't part of the loop.


#5

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