Solo flight (Solved-Coding Question)


#1

This is my code that worked for 'Solo flight':

//Remember to make your condition true outside the loop!

var soloLoop = function( count = 0 ){
//Your code goes here!
while ( count < 1 ) {
console.log("Looped once!");
count++;
}
};

soloLoop();

I was curious if this code was legit.
The lesson says to add the following to the end of the while loop, but is it necessary?

myCondition = false;


#2

You can use a number, or true/false. Doesn't matter, both are legit, but some are more suitable for certain situation (numbers are very useful when you need a fixed amount, true/false is very useful for example when prompting the user for input (you don't know how many times the user might give invalid input))

The bit i am confused about is the function, whhy did you simple do:

var soloLoop = function(){
  //Your code goes here!
  count = 0
  while ( count < 1 ) {
      console.log("Looped once!");
      count++;
  }
};
soloLoop();

No need to have a function argument, and if you do want a function argument you can simple do this:

var soloLoop = function(count){
  //Your code goes here!
  while ( count < 1 ) {
      console.log("Looped once!");
      count++;
  }
};
soloLoop(0);

You simple pass an argument when you create the function, and then when you call the function, you tell the function what the value of this argument is. I am not sure if you construction is actually valid