Home Manual Reference Source

Function

Static Public Summary
public

consume(iterator: Iterator, n: number)

Consumes a given number of iterations of the input iterator.

public

exhaust(iterator: Iterator)

Exhausts the input iterator.

Static Public

public consume(iterator: Iterator, n: number) source

Consumes a given number of iterations of the input iterator.

Params:

NameTypeAttributeDescription
iterator Iterator

The input iterator.

n number

The number of iterations to consume.

public exhaust(iterator: Iterator) source

Exhausts the input iterator.

Params:

NameTypeAttributeDescription
iterator Iterator

The input iterator.

Example:

let it = range( 1000 ) ;
exhaust( it ) ;
list( it ) ; // returns []