6. Solo flight


If have this infinite loop, can't see what is wrong, please help.

var myCondition = true
var soloLoop = function(){
  //Your code goes here!
  while (myCondition === true){
      console.log("Looped once!");
      myCondition = false;



Remove this comparison,


var loopedOnce = true;

var soloLoop = function(){
//Your code goes here!
while (loopedOnce);
console.log("Looped once!");
loopedOnce = false;


TypeError: loopedOnce is not a function
It still gives this error?


call your function by its name which is soloLoop not loopedOnce :slight_smile:


but then it gives the infinite loop


that's because you need an opening and closing bracket for your for loop,

i.e while loop,

while (CONDITION) {
    //while loop body


Yess, that's it, thanks a bunch


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