What wrong with this code?


#1

//Remember to set your condition outside the loop!
var count = 0;
var loop = function(food){
while(count<3);
{
console.log(food);
count++;
}
};

loop ("I'm Looping!");


introduction to while loops lesson 5


Replace this line with your code.


#2

HI what error do you get?

OR try that

this line remove the ; at the end

while(count<3); <--

#3

thank you, but after i did that it works, but I keep getting: 2 after my intended result.
Here's my code:
var count = 0;

while(count<3)
{
console.log("I'm Looping");	
count++;
}

#4

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