New answers tagged


When you have a collection that you want to iterate over, and you don't particularly care about the index of each element, iterating by going through the collection's .length and manually incrementing an index counter anyway is a bit tedious and ugly. Collections almost always have iterators or a forEach method - it's nice to use those instead, when possible....

Top 50 recent answers are included