Practice makes perfect while loops codecademy


#1

//Remember to set your condition outside the loop!
var count=0;

var loop = function(){
while(count>3){
console.log("I'm looping!");
count++;
}
};

loop();
whats wrong with this code anyone help please


#2

I don't remember how many times it's supposed to iterate, but it may be that it's supposed to say "I'm looping!" three times, and the way you have your loop makes your code display "I'm looping!" four times. Just try to change somethings around and see if that works


#3

Thanks for the suggestion.
actually i found the thing which went wrong as i mentioned the condition incorrectly while(count>3) instead of while(count<3)


#4

what is the problem??
//Remember to set your condition outside the loop!
var count = 0;

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

loop();