Determines whether all members of the stream satisfy the specified test.
Determines whether all members of the stream satisfy the specified test.
Returns the elements of the stream that meet the condition specified in a callback function. The function is called when the resulting stream elements are actually accessed, so accessing the resulting stream multiple times means the function is also called multiple times for each element of the stream.
Returns the elements of the stream that meet the condition specified in a callback function. The function is called when the resulting stream elements are actually accessed, so accessing the resulting stream multiple times means the function is also called multiple times for each element of the stream.
Returns the value of the first element in the stream that meets the condition, or undefined
if there is no such element.
Returns the value of the first element in the stream that meets the condition, or undefined
if there is no such element.
Returns a new stream with all sub-stream or sub-array elements concatenated into it recursively up to the specified depth.
Optional
depth: DThe maximum recursion depth. Defaults to 1.
Determines whether the stream includes a certain element, returning true
or false
as appropriate.
The element to search for.
Returns the index of the first occurrence of a value in the stream, or -1 if it is not present.
The value to locate in the array.
The stream index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
Adds all elements of the stream into a string, separated by the specified separator string.
A string used to separate one element of the stream from the next in the resulting string. If omitted, the steam elements are separated with a comma.
Returns a stream that yields the results of calling the specified callback function on each element of the stream. The function is called when the resulting stream elements are actually accessed, so accessing the resulting stream multiple times means the function is also called multiple times for each element of the stream.
Protected
recursiveCalls the specified callback function for all elements in the stream. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Calls the specified callback function for all elements in the stream. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
This method calls the function once for each element in the stream, providing the previous and current values of the reduction.
If specified, initialValue
is used as the initial value to start the
accumulation. The first call to the function provides this value as an argument instead
of a stream value.
Calls the specified callback function for all elements in the stream, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Calls the specified callback function for all elements in the stream, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
This method calls the function once for each element in the stream, providing the previous and current values of the reduction.
If specified, initialValue
is used as the initial value to start the
accumulation. The first call to the function provides this value as an argument instead
of an array value.
The default implementation of
Stream
works with two input functions:IteratorResult
.