While loop Practice makes perfect ( someone just tell me the answer)


#1



The hine says I haven't logged the I'm looping three times but i have times it by 3.

what am i doing wrong


//Remember to set your condition outside the loop!

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

loop();


#2

you have so much going on in this

1 while loops need brackets, just like a function, so you first want to start with:

	while(count<3){
	}

2 the point of the loop is to print "I'm looping!" 3 times, not for you to do it yourself. You need to make it print every time that it loops through. That's were the last part comes in

3 you need to increment count, or it will never stop looping

your function should look like this because of those things:

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

also, please don't just ask for the answer. you need to understand it, or you're going to have to ask for help every single time you do a new lesson.


#3

Why don't we need a parameter within function( )?

What is the purpose of loop( ); outside of the while loop and function?


#4

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