The iterator protocol specifies how to generate a sequence of values from an object.
An object qualifies as an iterator when it implements a next() method.
The next() method must return an object containing two properties:
value |
The value returned by the iterator |
done |
true if the iterator has completed |