Why is that an infinite loop?


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

var soloLoop = function(){
//Your code goes here!
var i = true;
while(i === true);{
console.log("Looped once!");
i = false;



Because, probably there's a semilicon after while loop condition and it probably terminates the process of executing other lines of code. while(i === true) { you don't need semilicon here.


Ah....yeah it was that ; which caused the problem. Thanks alot.


even worse :slightly_smiling:
If you have a look at this:

The ; here doesn't terminate the loop it somehow does the job of the part in {}. So this:

var i = true;
while(i === true);

would be an infinite loop.


You're right, as long as I can remember I've never faced with this problem, because it even didn't happen to me accidentally. :smiley: