When to 'while' and when to 'for' Issue



Browser is crashing, don't know why, doesn't appear to be an infinite loop.

for(var i = 1; i < 10; i++){

var progress = 3;
while(progress < 15){
    console.log("Not done looping");
    progress +3;

progress += 3 will increase by three each time.

If you don't want a strange number appearing in the console, put this line before the console.log() statement.


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