This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Introduction to 'For' Loops in JS Forum

View Course » View Exercise

345 points
513669d0e2cced1516001f48_802655295
Submitted by
Jordan Willoughby
over 4 years ago

I have a problem and I don't know how to fix it.

// Write your very own for loop!
for (var i=100; i>0; i-=5;) {
console.log(i)
}


2 votes

permalink

Your problem is that you added a semicolon after the 5. It shouldn't be there.
for (var i=100; i>0; i-=5) {
console.log(i)
}

2519 points
503cc4e842d646000202974a_858783378
Submitted by
Max Meijer
over 4 years ago