Function
Static Public Summary | ||
public |
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
import consume from '@iterable-iterator/consume/src/consume.js'
Consumes a given number of iterations of the input iterator.
Params:
Name | Type | Attribute | Description |
iterator | Iterator | The input iterator. |
|
n | number | The number of iterations to consume. |
public exhaust(iterator: Iterator) source
import exhaust from '@iterable-iterator/consume/src/exhaust.js'
Exhausts the input iterator.
Params:
Name | Type | Attribute | Description |
iterator | Iterator | The input iterator. |
Example:
let it = range( 1000 ) ;
exhaust( it ) ;
list( it ) ; // returns []