Last Practice For Loop


#1

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

it prints 100, what did I do wrong?


#2

Remove the semicolon after for(var i=100; i<=5; i-=5); <---


#3

Now it doesn't print anything, dookoo_de.


#4

Show me your code now, please


#5

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


#6

You should think about this line what did it say:

i<=5

#7

Ummmm, I'm not sure what to do


#8

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

it's giving me unexpected token but the space after that is blank, it can't mean I have extra spaces, cause I thought the spaces didn't matter, right?


#9

@thatoneguy74 you have an unnecessary semi colon before the closing bracket, and you don't have a semi colon after the second line. Also, if I'm not mistaken, the instruction asks you to count until 0, but not printing 0. Therefore your code shouldn't stop at 5.
Try this:

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

#10

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


#11

couldnt you just do i -=5) ?????