|
|
|
|
|
by afdbcreid
253 days ago
|
|
But the index is not yours. The iterator keeps it. > How do you accidentally modify an array, which would be different from any other variable? Like you cause any other simple bug. When there are tons of things and it's not a simple variable. Or even just a typo. That also happens. |
|
> Like you cause any other simple bug.
Yes, but we don't forbid modifying other things, just because you could modify them by accident, because you want to modify them some of the time. Why does a[i] = ... needs to be prevented, but a = ... is fine?