6. Solo flight


I don't understand at all this exercise. What would that While loop do?


"Oops, try again.Hey now--you have to use a 'while' loop!"

    //Remember to make your condition true outside the loop!
    var soloLoop = true;

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


Edit: where is the space for the while loop? What would it do? I have read everything so far by doing these exercises, but I dont understand what is the point of this exercise. What will it do with a function? Why there has to be a function?


where is the space for the while loop?

Inside of the function

What would it do?

Loop (repeat the code in its {} ) until the condition is false

What will it do with a function?

What a function does, run if it is called. No need to bother about it that much.

Why there has to be a function?

No idea. To practice, to make the code inside reusable, maybe it is just easier to test, idk. But as said it is not that important here just write your code in its {}.

And for informations about loops maybe have a look at this:


Here is the code that worked for me:
//Remember to make your condition true outside the loop!
soloLoop= true
var soloLoop = function(){
//Your code goes here!
console.log("Looped once!");
soloLoop = false

Hope it works! :grin:


Excuse-me guys.
I would like show my code to somebody help-me.

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

thank you.


Hi there,

The line "var my_condition = true;" should go outside the loop, on line 2 for example. The starting point needs to be defined outside the loop for it to work.


Also, I think you only need to put: while(my_condition)
There is no need to write: while(my_condition = true) as this is what the while function checks for anyway.
And I think you will also need to add {} to your "while" statement for it to work:
while(my_condition) {
console.log("Looped once!");
my_condition = false;
//and then you close the other bracket

I hope that makes sense? This is my first time answering on the forums


Thank you so much.

It works.



EDIT: Never mind, I found the problem. It was one missing curly bracket.


i don't know what is the wrong???

var code=true;
var soloLoop= function(){

    console.log("looped once!");




HI try to refresh the page...


Seems to be ok so far, what error message do you get? Have you tried to refresh the page as @wizmarco suggested?


this is not the problem i refreshed the page 10 times :cry:
ane this the massage error
Oops, try again. It looks like you're not printing the right string to the console


Maybe print looped with an upper case "L"? Really some exercises require exact copying of the mentioned text.


thank you soo much for ur time it is the solution