Returns an accumulator function which incrementally computes a product.
accumulator function
var accumulator = incrprod();
var v = accumulator();
// returns null
v = accumulator( 2.0 );
// returns 2.0
v = accumulator( 3.0 );
// returns 6.0
v = accumulator( 4.0 );
// returns 24.0
v = accumulator();
// returns 24.0
If provided a value, returns an updated product; otherwise, returns the current product.
Notes
NaN
or a value which, when used in computations, results inNaN
, the accumulated value isNaN
for all future invocations.value
product