8.last practice for loop


for ( i=100; i<0; i-=5 ){

Oops, try again. Your loop didn't log 100 to the console!

what is wrong with my code,please, help me


a for loop runs as long as the condition is true.
first run of the loop:
i = 100
i < 0
aka: 100 < 0, zero is not greater then 100. You might want to use > instead, this way the loop will run until the value is zero, then the condition is fasle


but what if you changed it like that and it still doesnt work?


then you should make your own topic with code + error message because then something else is wrong.This solution was specific for alexis


2 posts were split to a new topic: 8. last practice for loop


Oh its ok know
for (var i = 100; i >= 1; i-=5) {

Thats the code if you want to know it but really thanks :wink:



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