2.4.16.4.3 Enumerator.prototype.item ( )

If the this object is not an Enumerator object, raise a TypeError exception.

1. Let collection be the value of the this object’s [[Collection]] property.

2. If collection is undefined, return undefined.

3. Let state be the value of the this object’s [[EnumerationState]] property.

4. If state indicates that the end of the enumeration has been reached, return undefined.

5. Return the current enumeration item as indicated by state

Show: