Put that loop in a function Problem



I am having a hard time trying to figure this out. Is the problem in my for loop or my function?


Does it give you an error message? What exactly does happen when you run this?


oops, try again: false. Something to that effect.


I can’t really see anything wrong with the code myself, the only thing I notice is that the second line is not indented, though that probably wouldn’t make a difference. Is the program just trying to count up infinitely, or to a specific value?


It is supposed to count up to 10.


In that case, I think you’d need something to tell it that - for example

for (var i = 1; i <= 10; i++) {

This would set it to could up to 10 only I believe. I’m new to javascript myself, and not very good with it, so apologies if this doesn’t work haha


I will try that. thanks, xander.coder. I figured out the loop needs to repeat up until 11


This topic was automatically closed after 7 days. New replies are no longer allowed.