6. Solo Flight


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!");




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.


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


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


why do i keep looping forever?


general syntax for a while loop:

while (condition){
   // loops does something

your curly brackets ({}) are missing


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