I need help in solo flight code


#1

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

};

soloLoop();


#2

The problem is that you miss the {} around the stuff that belongs to your while loop:
What happens is that without {} the while just works on the next statement:

while(pak===true)
  console.log("Looped once!");

Now the problem should be obvious pak is true and stays true and your trapped in an infinite loop. I wrote a longer post about this behaviour in condition if you want to have a look:


#3

Thanks alot my code is good know