The iterator protocol defines a standard way to produce a sequence of values. It requires an object to have a
next method that should return an object with two properties:
value (the next value in the sequence) and
done (a boolean indicating if the sequence is complete).