5/9 Fifth Log Syntax Error


#1

What Am I Doing Wrong (Below):

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


#2

Here, you want to increment i by 5. i++ add +1 to i every time it goes through the loop. To do +5 instead, you need to change i++ to i += 5
Like this :
for (var i = 5; i < 51; i += 5) {
console.log(i);
}


<SOLVED> 6/9 Need Help
#3

i += 5 is a short way to say i = i + 5
so you reset the value of the variable i by adding 5
to "count down" you just use -=
good luck :grin:


#4

Also another way to say when the loop will end is either i < 51 or i <= 50, Both of these work!