The size of each combination.
Whether or not to allow duplicate elements in the combinations.
An iterator or iterable of falsey or truthy values to select which values to keep in this iterator.
Rest
...args: UThe number of times to cycle through the iterator (default: Infinity).
Divides this iterator into n
amount of smaller iterators while maintaining order. Note, this method will fully
iterate through this iterator before returning a result. If you don't want this behavior and don't care about
order then use distribute
instead.
A function that returns a truthy value to indicate to keep that value.
Finds the first value that passes a truthy value to predicate
, then returns it. Only consumes the iterator's
values up to the found value, then stops. So if it's not found, then the iterator is exhausted.
Maps this iterator to a new value R
and flattens any resulting iterables or iterators by a depth of 1.
Behaves the same as Array.prototype.flatMap
.
The number of levels to flatten (default: Infinity, i.e. deeply).
Groups consecutive keys in the input iterator by some key identifier function or property. Functionally equivalent to the itertools.groupby function in Python. Generally the input iterator needs to be sorted by the same key. Each iteration will return the next group of values with the same key, until the key changes. So unless the input iterator is sorted beforehand, you may have broken up groups with the same keys.
Returns true if value
strictly equals some value in this iterator.
Optional
size: SizeThe size of each permutation, must be greater than 0 and less than or equal to the length of this iterator.
Returns all successive size
length permutations of this iterator. The permutations are emitted in lexicographic
ordering according to this iterator. So if this iterator is sorted, the permutations will be in sorted order.
Elements in the permutations are treated as unique based on their position in the iterator, not on their value. So
if the input iterator is unique, then there will be no repeat values.
https://docs.python.org/3/library/itertools.html#itertools.permutations for more info.
Rest
...args: UOptional
repeat: numberOptional number of times to repeat (default: 1).
https://docs.python.org/3/library/itertools.html#itertools.product for more info.
Optional
repeat: numberThe number of times to resume the iterator (default: Infinity).
Collects all values from this iterator, then shuffles the order of it's values.
A seed between 0 and 1.
The index to start at (inclusive).
The index to end at (exclusive).
A new ExtendedIterator that only includes the elements between start
and end
.
Collects all values from this iterator, then sorts them.
The number of independent iterators to create.
Returns n
independent iterators, each of which is a copy of this iterator at the time of calling tee
. Once
tee
has made a split, do not modify or call upon the original iterator, as the new iterators will not be
updated/informed.
This caches the original iterator's values as the new iterators are iterated through. So
depending on the size of the original iterator, there could be significant memory overhead in using tee
.
tee
's intended use is to iterate over the returned iterators in parallel, or at least somewhat in parallel. In
general, if one returned iterator consumes most or all of it's values, then it is faster to just
use toArray
and then iterate over that.
Rest
...args: IteratorOrIterable<any>[]Rest
...args: IteratorOrIterable<any>[]
Extends and implements the IterableIterator interface. Methods marked with the
@lazy
prefix are chainable methods that modify the internal iterator, but don't start iterating. Methods without the@lazy
prefix do start iterating some amount, depending on the method.