2 ms·
>Yes, you actually have to read the statement `i += 1` in order to know what it does. Beginner here. Small detail... `i++` is read as `i = i + 1` and not `i
by Nadya 11y ago
>Yes, you actually have to read the statement `i += 1` in order to know what it does.
Beginner here. Small detail...
`i++` is read as `i = i + 1` and not `i += 1`. A small, but important distinction, especially for a beginner. `i += 1` is also parsed as `i = i + 1`.
However for `i += n` it no longer parses as `i = i + 1` but rather `i = i + n` which is a step more difficult (and more powerful) than i++ which is always `i = i + 1`. However that is additional complexity not found in `i++`.
(This is why I found `i++` easier than `i += 1`)