Did you log 'Looped once!' to the console?


#1

var myCondition = true;

var soloLoop = function(){

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

soloLoop();

I don't get what I'm doing wrong. Isn't this right?


#2

the exclamation mark (!) is missing in your case in looped once!


#3

and this line causes a problem:

var myCondition = false;

given you use the var keyword, the variable is local, which cause a bit of a problem, leave out the var keyword on this line


#4

Oh yep. That did the trick. Thanks