Readonly iteratorReturns a map consisting of the elements mapped by the given keySelector.
Returns a map consisting of the elements indexed by the given key.
Returns a map consisting of the elements mapped by the given keySelector. The value
is transformed into another value by the valueTransformer.
Returns a map consisting of the elements indexed by the given key. The value
is transformed into another value by the valueTransformer.
Returns the average of all numbers of the sequence or NaN if the sequence is empty.
Returns true if the sequence contains the given element.
Returns the number of elements of this sequence. If predicate is present, returns
the number of elements matching the given predicate.
Accumulates all elements of the sequence into a single result by applying the given operation starting with
the initial value. The result of the last operation will be passed as accumulated value to the getNext invocation
of the operation until all elements of the sequence are processed.
Accumulates all elements of the sequence into a single result by applying the given operation starting with
the initial value. The result of the last operation will be passed as accumulated value to the getNext invocation
of the operation as well as the index of the current element (zero-based) until all elements of the sequence
are processed.
Performs the given action (side-effect) for each element of the sequence and passes the index of the current
element (zero-based).
Returns the zero-based index of the given element or -1 if the sequence does not contain the element.
Returns true the sequence is empty
Returns true the sequence is not empty
Joins all elements of the sequence into a string with the given configuration.
Joins all elements of the sequence into a string with the given configuration.
Merges the elements of both sequences into a new sequence. Each element of this sequence is eventually replaced with
an element of the other sequence by comparing results of the given selector function. If no value is found in the other
sequence the element is retained. New elements of the other sequence are appended to the end of the new sequence or
prepended to the start of the new sequence, if prependNewValues is set to true. This operation is not lazy evaluated.
Evaluates the given predicate for each element of the sequence and assorts each element into one of two lists
according to the result of the predicate. Returns both lists as an object.
Appends the given element to the end of the sequence and returns a new sequence.
Appends the given array to the end of the sequence and returns a new sequence.
Appends the given sequence to the end of the sequence and returns a new sequence.
Reduces the whole sequence to a single value by invoking operation with each element
from left to right. For every invocation of the operation acc is the result of the last
invocation. For the first invocation of the operation acc is the first element of the
sequence.
Reduces the whole sequence to a single value by invoking operation with each element
from left to right. For every invocation of the operation acc is the result of the last
invocation. For the first invocation of the operation acc is the first element of the
sequence. In addition the index of the current element is also passed to the operation.
Returns the single element of the sequence or throws error if the sequence has more than
one element or none at all. If a predicate is passed returns the single element matching
the predicate or throws an error if more or less than one element match the predicate.
Returns the single element of the sequence or null if the sequence has more than
one element or none at all. If a predicate is passed returns the single element matching
the predicate or null if more or less than one element match the predicate.
Returns a new sequence with all elements sorted by the comparator specified by the given composeComparator function
or in natural order if no arguments are given.
Optional composeComparator: ((factory) => Comparator<T>)Returns a new sequence with all elements sorted ascending by the value specified
by the given selector function.
Returns a new sequence with all elements sorted ascending by the value of the given key.
Returns a new sequence with all elements sorted descending by the value specified
by the given selector function.
Returns a new sequence with all elements sorted descending by the value of the given key.
Returns the sum of all numbers.
Returns an async variant of the sequence.
Optional sequence: AsyncSequence<T>Returns a map consisting of each key-value pair. Pairs with null or undefined keys or values are discarded.
If a map is passed the pairs are set on this map. Duplicate keys override each other.
Returns a new sequence consisting of indexed values for all original elements.
A Sequence provides a fluent functional API consisting of various intermediate and terminal operations for processing the iterated data. The operations are evaluated lazily to avoid examining all the input data when it's not necessary. Sequences can be iterated only once.