This article is in need of a technical review.
The Iterator constructor is a SpiderMonkey-specific feature. For future-facing usages, consider using for..of loops and the iterator protocol
The Iterator function.
next ( )
- Returns an item .
An overview of the usage is available on the Iterators and Generators page.