6. Solo Flight


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

var soloLoop = function(){
while (soloLoop() == true)
console.log('Looped Once!');
soloLoop = false;



//What am i doing wrong??
// Error is RangeError: Maximum call stack size exceeded, but the loop should stop once told that soloLoop = false!


change the name of the function.
because you already set soloLoop= true

while (soloLoop() == true) // here missed a { bracket
and remove () brackets
here soloLoop() means you are calling the soloLoop function inside the same function thats not possible causing error Maximum call stack size exceeded
your code should be like

while (soloLoop== true){

next you have to close the function adding a } bracket
then call the function by function name
soloLoop() // change it


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