Last practise for loops error


#1


https://www.codecademy.com/courses/javascript-beginner-en-NhsaT/1/3?curriculum_id=506324b3a7dffd00020bf661#


Can't seem to get this to work at all and displayed error message "Your loop did not log 95 to the console"


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


#2

a loop will run as long in the condition is true, in the first run of the loop i is 100 so then this is the condition:

100 < 0

which is false. the loop will exit, hope this gives you insight to what is wrong with your code


#3

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