Introduction to while loops! its not working for me!


var count=0
var loop = function(count++){
	while(count < 3){
	    console.log("Im loopimg!")



The problem is that your loop is infinite.

Yes, you did try to say make count increase by one every time that the loop is run, but you passed it in as an argument to your function. This means that the loop isn't going to know when to stop. You need to find a new place to stick it (I'll leave that up to you :slight_smile: ).

One little side note: look for little bugs in your program, and see if you might have missed anything.


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