reduce
accepts
1
input stream,
an accumulator
,
a seed
(optional)
seed
will be used as an initial accumulation accaccumulator
returns a new stream of accumulated values
max
accepts
returns
This is how a ❚ max
operator would operate with an input stream:
Some reactive stream libraries (eg. RxJS) provide this ❚ max
operator, while others don’t. How would you code max yourself?
In RxJS, ❚ min
and ❚ max
accept on optional comparer function as an argument.
For example:
See also
Freelance Developer Advocate. Motion graphics with code. JavaScript and Elm. cedricsoulas.com
Receive my latest news, product updates and programming visualizations. You can unsubscribe at any time.