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 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.
Optional
fromIndex: numberThe stream index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
Returns an iterator for this stream. This is the same as calling the Symbol.iterator
function property.
Adds all elements of the stream into a string, separated by the specified separator string.
Optional
separator: stringA 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.
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.
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.
A tree stream is used to stream the elements of a tree, for example an AST or CST.