It Runs But Only Once


//Remember to set your condition outside the loop!
var count = 0;
var loop = function(){
while(count <= 3){
console.log("I'm looping");


It loops once then I get an error.


Inside for loop you have undefined variable counter. Instead of counter++ should be count++. So now with every iteration we add 1 to count while count will be equal to 3.


Thank you very much!


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