O padrão Iterator fornece uma maneira de percorrer uma coleção sequencialmente sem expor sua estrutura interna. É tão fundamental que está integrado na maioria das linguagens modernas (loops for-of, iteradores, geradores).
O que o padrão Iterator faz
ITERATOR → access elements of a collection SEQUENTIALLY without exposing its internals:
→ provides a standard way to traverse (next element, has more?)
→ the collection's internal structure (array, tree, linked list) is HIDDEN
→ decouples traversal logic from the collection
→ "iterate without caring how the collection is structured"
