Home Manual Reference Source

Function

Static Public Summary
public

chain(iterables: ...Iterable): IterableIterator

Chains input iterables one after the other.

Static Private Summary
private

* _chain(iterables: Iterable[]): IterableIterator

Chains input iterables one after the other.

Static Public

public chain(iterables: ...Iterable): IterableIterator source

Chains input iterables one after the other. Returns an iterable iterator that yields all values of the first input iterable, then all values of the second, etc.

Params:

NameTypeAttributeDescription
iterables ...Iterable

The input iterables to chain.

Return:

IterableIterator

Example:

// returns [ 0 , 1 , 0 , 1 , 2 ]
list( chain( range( 2 ) , range( 3 ) ) ) ;

Static Private

private * _chain(iterables: Iterable[]): IterableIterator source

Chains input iterables one after the other. Returns an iterable iterator that yields all values of the first input iterable, then all values of the second, etc.

Params:

NameTypeAttributeDescription
iterables Iterable[]

The input iterables to chain.

Return:

IterableIterator

Example:

// returns [ 0 , 1 , 0 , 1 , 2 ]
list( _chain( [ range( 2 ) , range( 3 ) ] ) ) ;