What i have to do i realy lost in while


count = 0

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


please give a link to the exercise you're on :slight_smile:


This would for a for loop but I believe you're working on while loops.


The way you could complete this while loop is by giving it a condition inside of parenthesis. You would only have to write while(count) and then you would open your curly braces and print I'm looping, (you did it correctly), but right after that on the next line, write count = 1 (or anything else). The point of assigning it a new value is so that your loop stops looping because it will create an infinite loop which is what you DON'T want.
Tell me if this helps!


that the best what i can do and he give me 1 i "am looping" and i need 3
var count=true;

var loop = function(count){
console.log("I'm looping!");
var count=false;





Practice makes perfect on while cours


you could loop 3 times with a while loop:

var loop = function(count){
	while(count is less then 3){
	    console.log("I'm looping!");
	    // increase count by one

i wrote the solution in pseudo code, you will need to convert it to usable code. You could simply check if count is less then 3, then inside the loop, increase the counter by one.

It is different syntax then the for loop, but it can be done.


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