I got problem in 5.Controlling the for loop


#1

The exercise is

This code counts every number from 0 to 35.
Make it start counting from 5. Please!
Stop the counting when it prints out 50.
Only count every fifth number. So we want to increment i by 5.

and my code looks like....

// Edit this for loop!

for (var i = 5; i < 51; i+5) {
console.log(i);
}

but it never works(it cause error, actually). i use chrome and i dunno what happens in this logic.

is there anybody has same problem?


#2

the statement the reads

i+5

should be

i+=5

you want to update the value of i in memory each time so you increment it by 5 and assign the result to i


#3

Damn, you beat me to it. But yeah, in your for loop, you need to set the value of i to increment by 5 each time (since that's what they're asking for you to do)


#4

Hey i have also done it that way but has failed