6. Solo Flight my code doesn't work


#1

Please help. what is wrong here?

https://www.codecademy.com/en/courses/javascript-beginner-en-ASGIv/1/2?curriculum_id=506324b3a7dffd00020bf661#

//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;
}
};
soloLoop();


#2

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

Remove the second var.


#3

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 =(

Ly


#4

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?


#5

===

!Thanks! Of course


#6