Browser Crashing!


#1


HEY PEOPLE!!! This code crashes my browser! Help me please!
var count = 0; count++;

var loop = function(){
	while(count < 3){
		console.log("I'm looping!")
	}
};

loop();


#2

Telling your browser to get real busy running your code will have that effect. Make sure that your code terminates and isn't getting stuck in an infinite loop.


#3

I know that the reason of crashing browser is the INFINITE LOOP!but I can't find it(:sweat:)


#4

Hi I think your "count++" on the first row is continuously adding numbers.
The count++ should be under the console.log


#5

Hey,thank you very much, @mverheij


#6

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