Class Iterator

This interface defines properties and methods for iterating over a collection; it provides the #next predicate and the #value read-only property. Some Iterators also provide key property values along with each value.

Hierarchy

Index

Properties

Methods

Properties

public count: number

Gets the total number of items in the iterated collection.

public iterator: Iterator

Returns itself, which is convenient for code that expects an Iterable instead of an Iterator.

public key: any

Gets the current index to the item in the collection, assuming #next has just returned true.

public value: any

Gets the current item in the collection, assuming #next has just returned true.

Methods

public first(): any

Return the first item in the collection, or null if there is none.

Returns

any

public next(): boolean

Call this method to advance the iterator to the next item in the collection.

Returns

boolean

public reset(): any

Start this iterator all over again.

Returns

any