Not the 'for loops' wot I learned in school!


If the loop ends when i < x, it's really just a disguised 'while' loop! Otherwise it could end when i = x-1. (I tried it and it crashes!)


Could you show the full example? Also this is pretty much THE for loop. Maybe you started with a more shallow dive and with the for in loop (which comes later when it gets to objects). Anyway the while loop, runs while the condition is true so if i<x is the condition then it will stop once i >= x.
Also i= x-1 is a really bad idea for a condition as it doesn't compare two values but sets i to be x-1 which is true for any x not equal to 1. Because any number used in a condition is true except 0 which is false.