Help pls


#1

var count=0

var loop = function(i=0;i,<3;i++){

	while(count<3){ console.log("I'm looping!")
	count=i
		//Your code goes here!
	}
};

loop();

whats wrong with this?

`


#2

This is not how functions work.

When declaring a function, inside the parenthesis you establish the parameters that it will look for.

What you're trying to do is make a for loop.

You use for loops, if you know how often you'll loop. The most often used varName in loops is i. (Taken from the JS Glossary, which can be found here.)

Syntax:

for ([var i = startValue];[i < endValue]; [i+=stepValue]) {
    // Your code here
}

#3

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