Mysterious infinite loop -review exercise


Can someone trouble shoot this code, I don't know why it keeps crashing

for(i=0;i<2;i++) {
    console.log ("For loopin");

var whileCond = true;
while(whileCond) {
    console.log("While loopin");
    whileCond = false;

var doCond = false;
    console.log("Do loopin");
    } while(doCond);


Wait, it just ran through fine this time. Must have been a hardware problem



You probably changed something without noticing.
You might for example have assigned something to console.log which caused an infinite loop, and then have removed the code but it still remained in memory until you refreshed the page which would reset the value for console.log to what it's supposed to be and suddenly you no longer had an infinite loop.

Or more likely yet, it wasn't an infinite loop, just something that couldn't be used as console.log, like the number 5 for example.