Function
Static Public Summary | ||
public |
Yields arrays that contain the current element of the input iterable and the
next |
Static Private Summary | ||
private |
Repeatedly yields the same deque that is updated to contain the current
element of the input iterable iterator and the next |
Static Public
public window(n: number, iterable: Iterable): IterableIterator<Array> source
import window from '@iterable-iterator/window/src/window.js'
Yields arrays that contain the current element of the input iterable and the
next n-1
elements of the input iterable.
Params:
Name | Type | Attribute | Description |
n | number | The window size. |
|
iterable | Iterable | The input iterable. |
Example:
window( 2, range( 100 ) ) ;
// is equivalent to
zip( range( 100 ) , range( 1 , 100 ) ) ;
Static Private
private _window(n: number, iterable: IterableIterator): IterableIterator source
import _window from '@iterable-iterator/window/src/_window.js'
Repeatedly yields the same deque that is updated to contain the current
element of the input iterable iterator and the next n-1
elements of the input iterable iterator.
Params:
Name | Type | Attribute | Description |
n | number | The window size. |
|
iterable | IterableIterator | The input iterable. |
Return:
IterableIterator |