6. Solo Flight - Quick question


#1



My code runs just fine, however, I am wondering why you need the "soloLoop();" at the very end of the syntax and what purpose that portion of the code serves.


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

soloLoop();


#2

By putting soloLoop(); at the bottom, you're calling on your function and telling it to run.

If you hadn't, then it wouldn't run


#3

Declared functions are not executed immediately. They are "saved for later use", and will be executed later, when they are invoked (called upon).

test your code without soloLoop();

so remember you have to call the function to make it any use.


#4

understood! Thank you.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.