Solo Flight! Error


#1

So far I've been having trouble doing this. I'm not sure what to write where 'myCondition' is.
https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/1/2?curriculum_id=506324b3a7dffd00020bf661
Here's my code:

var soloLoop = function(){
while(1 < 7){
    console.log("Looped once!")
  myCondition === false;

}
};

soloLoop();

#2

simple, do this:

var value = true;
var soloLoop = function(){
while(value){
console.log("Looped once!");
value = false;}
};

soloLoop();


#3

Remember, while loops look like this:

while(condition) {
// Do something!
}

So your loop should do something like this:

var myCondition = true;
while(myCondition) {
console.log("Looped once!");
myCondition = false;
}

This hint is taken directly from the instructions to this exercise @arquerkii. The instructions refer to the name of your variable as myCondition because it is up to you to name your variable. You named it soloLoop. Your variable should be assigned a value of true until it logs to the console. Then you should change the value of your variable. Otherwise, it loops more than once which defeats the purpose of the assignment.

On the 4th line of your code, you are calling myCondition which was never defined before your while loop. Substitute the variable you did define. Also, there is a difference between using = and ===.


#4

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