Can't seem to figure out why this isn't working in 8. Last practice for loop


#1

I keep getting an error message and cannot figure out what I am doing wrong. Please help!

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


#2

You must seperate the loop parts with a semicolon, not a comma. Example:

for (i = 0; i < 5; i++) {

#3

You must separate loop conditions with a semicolon. Counter, stopping condition and step should be separated by ;.
Write it like this.

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

#4

Thank you so much for your help!!!


#5

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

How come i get the error:

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

When i use this loop?

replacing <= 5 with >0 made it work, i just don't understand why
using <10 didn't work either, i'm confused.


#6

for (var i = 100 ; i > 0; i-=5) {
console.log(i);
}
// Aí está, o laço for faz o computador contar de ( 100 até 0 ), de ( 5 em 5 ). Dessa vez, ele não exibe o ( 0 )