El patrón Iterator proporciona una manera de recorrer una colección secuencialmente sin exponer su estructura interna. Es tan fundamental que está integrado en la mayoría de los lenguajes modernos (bucles for-of, iteradores, generadores).
Qué hace el patrón Iterator
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"
