Lesson 5 Controlling the for loop


Syntax error!

What am I doing wrong?

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

Urg... I find these instructions confusing!

My code:

for (var i = 0; i <= 50; i < 35; i+5;) {


FINALLY... Solved it... Knew it wasn't that hard

for (var i = 5; i < 51; i+=5) {


My god.. why didn't I think of that. Thanks.


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


This should do the trick


pinched myself when i saw this lol thanks


I just did that and I only got an error
Which says: unexpected token.
But just where?!


And it works..thanks:sweat_smile: