Intro For Loops


#1



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


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


#2

You're subtracting by intervals of five. What's 100 / 5? It will only be able to log 20 times.

Try setting i to 500, or subtracting by 1.


#3

Do I log the start, to 500, or the ending number to 500?


#4

You'd make the variable, i 500.
so it'd be


#5

Like this?
for (var i = 500; i = 0; i-= 5) {
console.log(i);
}
Because the same message pops up anyway.


#6

The instructions say "This time, make sure not to print 0" (and it also says to go by increments of five, sorry. I thought you were doing that on your own accord.

So you would want to set it greater than or equal to.

Try


#7

Hey that worked! Thank you!


#8

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