new arrgh.Iterator(moveNext, current)
Supports iteration over a collection.
Name | Type | Description |
---|---|---|
moveNext |
function | A parameterless function that moves the iterator to the next position. |
current |
function | A parameterless function that returns the value at the current position. |
Methods
-
current(){*}
-
A parameterless function that returns the value at the current position.
Returns undefined when the iterator is at its initial position or when moveNext returns false.Returns:
Type Description * - Returns the value at the current position of the Iterator. -
moveNext(){Boolean}
-
A parameterless function that moves the iterator to the next position.
Returns false when no next position is found.Returns:
Type Description Boolean - Returns whether the Iterator has moved to the next position.