6. Solo Flight my code doesn't work


Please help. what is wrong here?


//Remember to make your condition true outside the loop!
var condition = true;
var soloLoop = function(){
  while(condition = true){
console.log("Looped once!");
  var condition = false;


In your loop, you redefine the condition variable which should not be done. You must simply set its new value.

Remove the second var.


Nope, I copied the whole code and removed the second var. Still getting rainbow spinning thing and had to force quit. This should work but doesn't =(



in js, a single equal sign means assign:

while(condition = true)

is that really what you want to do here? Assign true to condition? How in js do we check if things are equal?



!Thanks! Of course