6. Solo Flight


#1

Instructions:
Inside the soloLoop function, write a while loop that takes an initial condition that's true. Your loop should log "Looped once!" to the console, then change that initial condition to false.

MAKE SURE to set your condition to false in the body of your loop. Otherwise, you'll loop forever!

//Remember to make your condition true outside the loop!
var myCondition = true;

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

}

};

soloLoop();

That is what I have so far. I know its wrong, but im not sure what parts I need to fix or what I need to add.


#2

on the line where you set myCondition to false, you misspelled myCondition


#3

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

soloLoop();

why do i keep looping forever?


#4

general syntax for a while loop:

while (condition){
   // loops does something
}

your curly brackets ({}) are missing


#5

of course it would be something as simple and silly as that! thank you so much!