Lesson 6 . finding it hard . want solution


#1

can anybody give me the solution of lesson 6. i am finding it hard. most of the time the webpage gets freezed ,maybe crashed.

#2

asking for solutions is not according to the guidelines, based on your description you have an infinity loop, post your code so we can help you


#3

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

soloLoop();

this is my code . can you say me the corrections in it?


#4

this is the code you start with:

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

var soloLoop = function(){
  //Your code goes here!
  
};

soloLoop();

on line 2, before the function, create a new variable, for example call it condition, and set it to true.

then inside the function (below the comment your code goes here) add the while loop, set the condition of the while loop to check if condition (the name of the variable you declared on line 2) equals true (comparing requires two equal signs)

then inside the loop, update condition to false


#5

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