Transducer which performs "scan" operation via given reducer.
If an input src is given an initial result init must be provided too as arg. Use null or undefined to use the given reducer's default.
src
init
null
undefined
https://en.wikipedia.org/wiki/Prefix_sum#Scan_higher_order_function
[...iterator(scan(add()), range(10))] // [ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45 ] [...scan(add(), null, range(10))] // [ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45 ]
reducer used as scan operator
-
Generated using TypeDoc
Transducer which performs "scan" operation via given reducer.
If an input
src
is given an initial resultinit
must be provided too as arg. Usenull
orundefined
to use the given reducer's default.https://en.wikipedia.org/wiki/Prefix_sum#Scan_higher_order_function
[...iterator(scan(add()), range(10))] // [ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45 ] [...scan(add(), null, range(10))] // [ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45 ]