EnumerateIterator Reference
An EnumerateIterator enumerates the provided iterator starting at 0. It inherits from Iterator.
Constructor
Section titled “Constructor”Creates an iterator to transform another iterator.
var iterator = ArrayIterator([1, 2, 3]);var enumerated_iterator = EnumerateIterator(iterator);Parameters
Section titled “Parameters”iterator: Iterator - The iterator to enumerate.
start: Number? optional - The number to start enumeration with. Defaults to 0.
Methods
Section titled “Methods”Inherited
Section titled “Inherited”All methods are inherited from the Iterator class. See the Iterator reference for documentation.
Example
Section titled “Example”var iterator = ArrayIterator([1, 2, 3]);var combined_iterators = EnumerateIterator(iterator).for_each((pair) -> { println("Left: " + to_string(pair.left) + " Right: " + to_string(pair.right));});// "Left: 0, Right: 1"// "Left: 1, Right: 2"// "Left: 2, Right: 3"