Tutorials/For Loops
-
First, the documentation explains that :
- The program above is a counter from 0 to 10.
And next, it's explained that : - It will count from 0 to 9 and will not reach 10.
So is it really a counter to 10 ? Shouldn't it be ?
- The program above is a counter from 0 to 9.
- The program above is a counter from 0 to 10.
-
While the syntax is like BASIC where it goes from 0 to 10 inclusive (making it 11 iterations), the execution is closer to languages like C, where the beginning is included but not the end.
for( i = 0; i < 10; i++ ) { }
So it's not a bug. However, when decrementing, it does include the last number, and I believe that's considered a bug
-
No the report here is correct. The documentation is incorrect and it should say it is a counter from 0 to 9 and not 0 to 10