What is the condition suppose to be? While loop


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-ASGIv/0/2?curriculum_id=506324b3a7dffd00020bf661

I have tried many different conditions already and none of the ones I put in are working. Either my browser crashes or it says there is a problem with my loop syntax. The only direction says to "add the condition between the parentheses. I don't know what kind of condition they want though.


Replace this line with your code. 
var understand = true;

while( condition? ){
	console.log("I'm learning while loops!");
	understand = false;
}


#2

Here,

in the parentheses you should have understand.

Thus why you increment it here,


#3

Wow, I knew it would be so simple too. I might have thought this worked like an if, where it would be - while (understand = false). But I see how they connected it now.


#4

//Remember to set your condition outside the loop!

count = 0;
var loop = function() {

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

};

loop();

can someone tell me where my code is off, thanks


#5

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