Increment inside for loop in Javascript

The for loop only stops if the condition is not met. In this case, i = 5 after it is increased inside the last loop. Hence, it breaks out of the condition. Therefore i is 5 when it is printed.

Leave a Comment