Design Pattern: Iterator Pattern in PHP

Iterator pattern is used to access items sequentially from an aggregated object. The client does not need to know the underlying details of the iterator, it can just use the iterator easily. This pattern makes it very easy for the client to traverse through a list of objects, one by one. It can also implement the traversing process in any order (ascending or descending) if required. This article demonstrates the Iterator pattern implementation in PHP.

Design Pattern: Iterator Pattern in TypeScript

Iterator pattern creates an interface for the client to access the internal list items of a collection. The implementation hides the underlying complexity from the client and makes it very simple for the client to traverse a list of items. In this article, we are demonstrating Iterator pattern implementation in TypeScript.