Finding bug


i have a bug in introduction to while loops in JS , chapter 5 pratice make perfect
after i click save and submit the page suddenly not responsive i restart the page but still cant
this problem is already few day i cant continue learning like that please help me


sounds like a infinity loop, please copy paste your code to the forum so we can help you


//Remember to set your condition outside the loop!
var count = 0 ;

var loop = function(){
while(count < 3){
console.log ("i'm looping") ; //Your code goes here!



count is and stays zero? so the loop condition will always evaluate to true, zero is smaller then 3


then shoulod i change the count to number greater then 3 ?


inside the loop i would increase count so that eventually the loop condition becomes false after several iterations


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