I wanted to iterate that Collections are a very important concept in many programming languages. The default for loop with (init ; condition; increment) is not as much seen in updated languages, as it is more prone to errors, then the looping of Collections either thru ‘Functional Programming’ .map or .forEach (javascript) or ‘for x in array’ (python), these are other ways of looping thru arrays without having to worry about being ‘out of bounds’ at run time.
It should be noted that for each has its own possible problem situations, etc. The more you use them the more likely you will understand the limitations. They show up at times.
All loops are worth something. Just because a bunch of people feel they’re an old way doesn’t make them worthless
I don’t get the mentality that something is better than the other things. eg language with less code is better. The problem is that it will have more code at times, still have bugs, still create bugs, etc. Inside I cringe every time I hear it.
Also to add, you don’t need to really worry about ArrayIndexOutOfBounds anyway as you can catch that or otherwise check for that.